//clrscr.h
#pragma once
#include <windows.h>
#include <iostream>
#include <conio.h>
using namespace std;
void clrscr()
{
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen,
&cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
}
#include <clrscr.h>
using namespace std;
int main(){
cout<<"Animesh";
clrscr();
return 0;
_getch();
}
When I run the above .cpp file in the 'Compiler' window I get a msg.
[Warning] no newline at end of file
Therefore, I am getting the wrong output .... please help ...... !!!
:)