The codes for the two programs are,
p1.c:
#include <stdio.h>
int main () {
printf("Program1");
return 0;
}
p2.c:
#include <stdio.h>
int main (char argc, char *argv[]) {
printf("%s", argv[1]);
printf(" | Program2");
return 0;
}
When p1 | p2
is entered in the CMD, the expected output
is: Program1 | Program2
. But the output I get is: (null) | Program 2
. Clearly the output of the p1 is not taken in from p2. How can I resolve this issue?