0
//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 ...... !!!
:)

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by apanimesh061
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.