this is the updated code...
Code:
#include <iostream>
#include <stdlib.h>
#include <string>
#include <unistd.h>
void main()
{
char cmd[100] = " ";
char * pch;
cout << "Please enter command: ";
cin.getline(cmd, 100);
while (strcmp (cmd, "exit") !=0)
{
if((cmd[0] == "c") && (cmd[1] == "d"))
{
pch = strtok(cmd," ");
pch = strtok(NULL," ");
chdir(pch);
}
else
{
system (cmd);
cout << "Please enter command: ";
cin.getline(cmd,100);
}
}
exit(1);
}
and there are the errors im recieving from my linux compiler
test.cpp:16: ISO C++ forbids comparison between pointer and integer
test.cpp:16: ISO C++ forbids comparison between pointer and integer