How can I use the pause to make it works in any OS using standar c++ library, I easily found how to do with the cls command, but i cant find how to do with pause.
As a general rule, it is better to try and avoid the use of system - not only due to OS incompatibilities, but also for security reasons. Instead, consider the following (cross-platform) method for pausing:
1 2 3 4 5 6
#include <iostream>
void pause() {
std::cin.sync(); // synchronize and clear the buffer
std::cin.get(); // retrieve a linefeed from the user.
}
As for clearing the screen, the easiest way is simply to do this:
std::cout << std::string(80, '\n');
If you really need it, though, there is always the curses library (which provides a bunch of handy functions - look it up), or various platform specific ways. Have a look at this article: http://www.cplusplus.com/articles/4z18T05o/