Showing posts with label settextcolor. Show all posts
Showing posts with label settextcolor. Show all posts

18 Apr 2013

Using Gotoxy(position) and text color in Dev c++ Editor....

Using Gotoxy(position) and text color in Dev c++ Editor....


#include"stdio.h"
#include"iostream"
#include"conio.h"
#include"windows.h"

using namespace std;
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
COORD CursorPosition;

void gotoxy(int x, int y)
{
CursorPosition.X = x;
CursorPosition.Y = y;
SetConsoleCursorPosition(console,CursorPosition);
}

void settextcolor(int color)
{
    HANDLE h;
    h=GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(h,color); 
}
int main()
{
gotoxy(15,5);
settextcolor(6);
cout<<"This Blog is AwesomE.";
return 0;
}

Comments

© 2013-2016 ITTechnocrates. All rights resevered. Developed by Bhavya Mehta