10-20-2009, 03:28 PM
the thing with the system command is every time you run a new system () call it creates a new shell, so doing something like
instead of printing out C:\ for the second system call it would still print the working directory of the program.
Code:
int main ()
{
system ("cd /D C:\\");
system ("cd");
system ("pause >nul");
}