Hi to all!
I have one big problem. I have written some code and I want to program
at the end looks good but theres one uninspected error.
What's going on?
I have written code for programm that needs to do input, output and
searching, for looking better i wanted to use simple DOS word cls
but(!!!!) in C/C++ there i cant use it. so I looked over the internet
and nearest i could find it's this code:
#include <iostream.h>
#include <windows.h>
#include <process.h>
void gotoxy(int, int);
void clrscr();
int main(){
clrscr();
gotoxy(10,10);
cout << "at 10,10";
gotoxy(10,20);
cout << "at 10,20";
gotoxy(20,10);
cout << "at 20,10";
gotoxy(20,20);
cout << "at 20,20";
return 0;
}
void gotoxy(int x, int y){
HANDLE hConsoleOutput;
COORD dwCursorPosition;
cout.flush();
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsoleOutput,dwCursorPo sition);
}
void clrscr(){
system("cls");
}
I have compiled it in Microsoft Visual Studio 6.0 and there i had
error, it said :
c:\program files\microsoft visual studio\vc98\include\eh.h(32) : fatal
error C1189: #error : "eh.h is only for C++!"
I looked for line where it is and that becomes that it's in standard
Microsoft Visual Studio 6.0 header file eh.h
line around the error are this:
#ifndef __cplusplus
#error "eh.h is only for C++!"
#endif
So my question is what i have to do to fix this error. I tried a lot of
combinations but I failed.
Thank You for help.