Author Topic: VC++ Console Application - clrscr function (Turbo C Equivalent Function)  (Read 1189 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Here is the turbo c / c++ equivalent source code for gotoxy and clrscr are given below:

Code:
//Source Code Listing

#include <windows.h>


void gotoxy(int x, int y)
{
   COORD ord;
   ord.X = x;
   ord.Y = y;
   SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), ord);
}

void clrscr()
{
   ::system("cls");
/***
// Alternate implementation
   for(int i = 0; i < 80; i++)
      for(int j = 0; j < 25; j++)
      {
         gotoxy(i,j);
         cout << " ";
      }
   gotoxy(0,0);
***/

}

« Last Edit: November 14, 2011, 11:36:04 am by kathir »

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1