get output of system()

is there any function that execute a command on shell and return the answer
for example when i pass "ls" to this function it return list of files in current directory
thanks
No, but system() returns the return value of the program's main(), IINM.
It returns the value returned by the shell, which with cmd.exe and sh is the value returned by the program's main function.
That never seems to work for me. I wanted a command line calculator ages ago; but I never got the right answer. Then again, that may be becuase I was casting argv[i] instead of using atoi()...
Topic archived. No new replies allowed.