I have 2 C programs.
Say one is program-1.c
int main(){
printf("hello world");
}
Now in 2nd code named program-2.c, I want the output of 1st code into a variable,
so that I can have the output “hello world” into a variable in the 2nd C code.
How can I do this?
You can use the
popenfunction for this: