// changeDir.c++ changes the current working directory // by calling chdir() // $ ./a.out #include using namespace std; #include #include int main(int ac, char *av[]){ char *cwdP; // changeDir.c++ if(ac < 2){ cout << "No path specified\n"; return 0; } cwdP=get_current_dir_name(); cout << cwdP << endl; chdir(av[1]); cwdP=get_current_dir_name(); cout << cwdP << endl; return 0; }