I am new in C program and linux, how can we compile and run this program?
I have tried gcc example.c then ./a.out but it gives an error like input file cannot be opened ( I have written this error in the read method)
// example.c
int main(int argc, char *argv[])
{
char* input = argv[1];
read(input);
char* output = argv[2];
write(output);
return 0;
}
Thanks.
./a.out FILE1 FILE2.gcc -std=gnu99 -Wall -g example.c -o myprog, improve your code till you get no more warnings, then run./myprogand learn to use thegdbdebugger