Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h> //usado com o gotoxy
- void gotoxy(); //declarando a função gotoxy
- int main (){
- gotoxy(15, 10); //15 equivale ao X, que é horizontal. 10 equivale ao Y, que é vertical.
- //você pode usar variáveis ao invés de números tb para facilitar!
- printf("Teste!!");
- getch();
- //EXEMPLO USANDO COM VARIÁVEIS
- system("cls");
- int i, y, x;
- x = 5, y = 5;
- for (i = 0; i < 20; i++){
- gotoxy(x, y);
- Sleep(200);
- printf("Testando!!");
- x += 1;
- }
- return 0;
- }
- void gotoxy(x, y){
- HANDLE k = GetStdHandle (STD_OUTPUT_HANDLE);
- COORD position = {x, y};
- SetConsoleCursorPosition (k, position);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement