system issues

hi whats up! im working on a program that will cd the top directory.


system("cd /");
i just want is to do this. it compiles just fine but when i run the command nothing happens. i think it might have to do with the space cause it doesnt do anything when you just type cd and it doesnt display anything either. sadly since its linux and not widows i have to put space. i tried to use the ascii value for space and still the same result. this would really help out.

What did you expect to happen? cd doesn't print anything when it is successful.
Why use cd command after all ? As far as I know there is chdir() CRT function, use it.
whats a example to put in the parameters
thanks that worked
Topic archived. No new replies allowed.