Goveynetcom
July 19th, 2010, 04:49 AM
Hello all.
I recently got back into programming (I started but then gave up, and now that I have free time I got back into it). I am C++ programmer, and am still learning the ropes. I have a question, how do I get the system commands to work under Linux? I can't seem to get them to work. I want to be able to let the user clear the text so they can easily read the new output. Reading various things, on windows I should just to have to do this;
int main()
{
//code
system("CLS");
//code
}
I read for Linux that I need to do this;
int main()
{
//code
system("clear");
//code
}
But anytime I do that in my program, I just get an undefined error in g++. I'll assume the command should work but I am not using a correct library. Anyone want to help me out here?
I recently got back into programming (I started but then gave up, and now that I have free time I got back into it). I am C++ programmer, and am still learning the ropes. I have a question, how do I get the system commands to work under Linux? I can't seem to get them to work. I want to be able to let the user clear the text so they can easily read the new output. Reading various things, on windows I should just to have to do this;
int main()
{
//code
system("CLS");
//code
}
I read for Linux that I need to do this;
int main()
{
//code
system("clear");
//code
}
But anytime I do that in my program, I just get an undefined error in g++. I'll assume the command should work but I am not using a correct library. Anyone want to help me out here?