Thank you for your advice, but can you help me with some piece of code ?
I found this with google, but it copies an output from a shell, to a file:

char line[100];
in=popen("ls -l", "r");
FILE * out = fopen("filename", "w");
while(fgets(line, sizeof line, in))
fprintf(out, "%s" line);
fclose(out);

What i want is to take the value of a variable from a first program and assign it to another variable from another program; both programs will run in the same time..

Thanks