by glinka57 on Mon Jul 13, 2009 5:21 pm
- Code: Select all
#include "stdafx.h"
#include <iostream>
using namespace std;
#include <windows.h>
/*
windows.h
- I needed the COORD class which is found in this header
- I needed the Sleep(int); function which is defined in this header
lol dont forget that capital S on Sleep, sheesh
the int is a number of milliseconds; so Sleep(1000); pauses the console for 1 second
- I needed the function:
SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
which is defined in this header
*/
void gotoxy ( short x, short y )
{
COORD coord = {x, y};
SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
}
//This func allows you to spicify the cursor's position
// check http://cpptutorials.freeforums.org/select-character-insertion-point-t213.html for the details
// about the gotoxy(); function
void main()
{
for(int x=0;x<x+1;x++)
{
gotoxy(40,10);
cout<<x<<"\n";
Sleep(85);
}
}