I am beginner in C. I have a program which runs another simple addition program using system("subprogram.exe")
function. Now this subprogram gets two integer inputs,how can I give input to the subprogram.c
file from my main program.
Main Program:
#include<stdio.h>
int main()
{
int a,b;
a=10;
b=10;
system("subprogram.exe");
}
Now subprogram has this following code..
#include<stdio.h>
int main()
{
int a,b,c;
c=a+b;
printf("%d",c);
return 0;
}
How to copy the values from 'a' and 'b' from "main program" to the "subprogram"?