Skip to main content

C++ - Move cursor position (windows)



#include "stdafx.h"
#include "Windows.h" 

int main()
{
	for(int i=1 ; i<200 ; i++)
	{ 
		SetCursorPos(200/i, 200*i);
		Sleep(500);
	}
	
	return 0;
}

Popular posts from this blog

C++ - Print Size of Fundamental Types

  #include <iostream> using namespace std; int main() { cout << "sizeof(char) is " << sizeof(char) << " bytes " << endl; cout << "sizeof(short) is " << sizeof(short) << " bytes " << endl; cout << "sizeof(int) is " << sizeof(int) << " bytes " << endl; cout << "sizeof(long) is " << sizeof(long) << " bytes " << endl; cout << "sizeof(float) is " << sizeof(float) << " bytes " << endl; cout << "sizeof(double) is " << sizeof(double) << " bytes " << endl; cout << "sizeof(bool) is " << sizeof(bool) << " bytes " << endl; return 0; }

C++ assert.h

  #include #include int test_assert(int x) { assert(x <= 4); return x; } int main() { int i; for (i=0; i<=9; i++) { test_assert(i); printf("i = %d\n", i); } return 0; }