getch() & clrscr() errors
2 posters
getch() & clrscr() errors
#include <iostream.h>
int main()
{
clrscr();
int x,y,sum;
float average;
cout << "Enter 2 integers : " << endl;
cin>>x>>y;
sum=x+y;
average=sum/2;
cout << "The sum of " << x << " and " << y << " is " << sum << "." << endl;
cout << "The average of " << x << " and " << y << " is " << average << "." << endl;
getch();
}
----------------------------
..\world.cpp:14: error: `getch' was not declared in this scope
..\world.cpp:5: warning: unused variable 'clrscr'
..\world.cpp:14: warning: unused variable 'getch'
int main()
{
clrscr();
int x,y,sum;
float average;
cout << "Enter 2 integers : " << endl;
cin>>x>>y;
sum=x+y;
average=sum/2;
cout << "The sum of " << x << " and " << y << " is " << sum << "." << endl;
cout << "The average of " << x << " and " << y << " is " << average << "." << endl;
getch();
}
----------------------------
..\world.cpp:14: error: `getch' was not declared in this scope
..\world.cpp:5: warning: unused variable 'clrscr'
..\world.cpp:14: warning: unused variable 'getch'
jennyinhere- Posts : 24
Points : 30
Join date : 2010-02-26
Age : 35
Re: getch() & clrscr() errors
getch() and clrscr() are part of conio.h header file. conio.h is used in old MS-DOS compilers to create text user interfaces but not a part of standard c library. So if u r using "MinGW" or "Cygwin" compilers, they wont support these functions.
Permissions in this forum:
You cannot reply to topics in this forum
|
|