IIRC, it worked just fine. You aren't seeing output because of the way Turbo C/C++ initializes the console output.
The problem is that you are doing something wrong. Are you trying to get a directory listing? Or just show it to the user?
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
system() command used here should generate desired output for dir, And i agree with Duoas as per output on console is concerned.
Though to validate system call functionality, one can try to redirect the output to a file.
void main()
{
system("dir >>test_dir.lst");
getch();
}
check 'test_dir.lst' for the desired output.
tajendra
Junior Poster in Training
53 posts since Mar 2010
Reputation Points: 34
Solved Threads: 7