As the title says, I cannot use "cd" in even a super simple C++ program. More accurately, I CAN use it (i.e. it compiles and doesn't throw any errors) but it carries on as if I haven't.
My code is as follows:
#include <iostream>
#include <cstdlib>
int main()
{
system("cd");
system("dir");
system("cd C:\\Users\\Sajado");
system("dir");
return 0;
}
The output window returns the directory listing of the project directory both times. I have also tried using paths other folders, both higher and lower, and
cd ..
has no effect either.
I am using codeblocks if that helps. I'm no C++ or cmd expert by any means so I may be missing something very obvious. Anyone know why this might be misbehaving?