I have Win XP. When I open the DOS prompt using "cmd", and then,
from the DOS command line, I type a command like this, it works:
c:/cygwin/bin/ls > file.txt
When I try to compile the following C program using GCC, it does compile, but when I run the executable, the system () command doesn't run. Anyone knows how to fix this code to make it run? Thanks.
Code:#include "stdio.h" #include "string.h" #include "stdlib.h" main (argc, argv) int argc; char *argv []; { system ("c:/cygwin/bin/ls > file.txt"); return 0; }