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:
Program that receives the value returned by the previous program:Code://program-1.c int main(void) { return 10; }
On the console I wrote down:Code://program-2.c#include <stdio.h> int main(int argc, char* argv[]) { printf("%i", argv[1]); }
But the output is 0, not 10.Code:program-1.c | program-2.c
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 ()?