How should I call System C call if I want to send echo $c > 1.txt? I was able to send c to 1.txt but how can I send $c (in script sense) in C code (i.e., the value in c)?
My code is something like this:
void main() {
    int c =100;
    system("echo c > 1.txt");
}
I would like to save 100 in the file 1.txt
 
     
     
    