Passing return value from one main to other main function?
I wonder if it is possible to pass a return value from one main function as input value to another main function.
For example:
Program that passes a value:
Code:
//program-1.c
int main(void)
{
return 10;
}
Program that receives the value returned by the previous program:
Code:
//program-2.c
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("%i", argv[1]);
}
On the console I wrote down:
Code:
program-1.c | program-2.c
But the output is 0, not 10.
Is it possible that program two returns the value 10 from program 1?
What must be done so that the return value of program 1 is received by program 2 and displayed on screen by printf ()?