How do I use system ("cls") or system ("pause") commands on xcode? Obviously he does not interpret them as they are not system commands, how can I do it?
Asked
Active
Viewed 155 times
2 Answers
0
What happens if you use the following code on Linux or macOS?
system("cls")
Or,
system("md hello-folder")
Obviously they won't work since the're unknown in Unix and macOS systems. Instead, they're platform dependent and only will work for Windows.
Although there are several commands which helps to clear the terminal screen, referring you to visit this thread of SO. You may try those commands under system()
.
Disclaimer: system()
shouldn't be used on larger productions which are said to be platform-independent, more information here.

Rohan Bari
- 7,482
- 3
- 14
- 34
0
When i use system(), the compilator can't run that command because it's a windows one.
So.. i saw that i could use CMD+K
but i need that command in the code
E.g.
system("cls");
cout<<"Hello"<<endl;
system("pause");
system("cls");
That's all... I need to make the command works

GennyTaf
- 1