Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************* Gotoxy para Linux ********************************/
- /*
- //Función para convertir cualquier tipo de datos a string.
- template <class T>
- inline string ToString(const T& t) {
- stringstream ss;
- ss << t;
- return ss.str();
- }
- //Función para emular al gotoxy en la consola de Linux.
- inline string gotoxy(const int& x,const int& y) {
- return "\33[" + ToString(x) + ";" + ToString(y) + "H";
- }
- */
- /************************* Gotoxy para windows ********************************/
- void gotoxy(int x,int y){
- HANDLE hcon;
- hcon = GetStdHandle(STD_OUTPUT_HANDLE);
- COORD dwPos;
- dwPos.X = x;
- dwPos.Y= y;
- SetConsoleCursorPosition(hcon,dwPos);
- }
- /******************************************************************************/
- void borrarPantalla(){
- ///system("clear"); //LINUX
- system("cls"); //WINDOWS
- }
- /******************************************************************************/
- void pausa(){
- system("pause >nul"); //WINDOWS
- /* cout<<"presione enter para continuar"<<endl; ///LINUX
- cin.ignore ();
- cin.get(); */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement