473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to correct error of " the function getch() should have a prototype"

i have got an error how can i correct it. "the function getch() should have a prototype"


Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<string.h>
  3. class employee
  4. {
  5. char name[80];
  6. public:
  7. void putname(char *n);
  8. void getname(char *n);
  9. private:
  10. double wage;
  11. public:
  12. void putwage(double w);
  13. double getwage();
  14. };
  15. void employee::putname(char *n)
  16. {
  17. strcpy(name,n);
  18. }
  19. void employee::getname(char *n)
  20. {
  21. strcpy(n,name);
  22. }
  23. void employee::putwage(double w)
  24. {
  25. wage=w;
  26. }
  27. double employee::getwage()
  28. {
  29. return wage;
  30. }
  31. int main()
  32. {
  33. employee ted;
  34. char name[80];
  35. ted.putname("gaurav bhadani");
  36. ted.putwage(75000);
  37. ted.getname(name);
  38. cout<<name<<"makes $";
  39. cout<<ted.getwage()<<"per year.";
  40. getch();
  41. return 0;
  42.  
  43. }
May 28 '10 #1
1 15585
Banfa
9,065 Expert Mod 8TB
That is a C++ program and you are using C++ io (cout) so you should avoid using C io via getc().

If you really need to do that then

Expand|Select|Wrap|Line Numbers
  1. char c;
  2. cin >> c;
  3.  
Also

#include<iostream.h>

Is the pre 1998 standardisation version of the header and may not be portable use

Expand|Select|Wrap|Line Numbers
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
May 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: deko | last post by:
After developing an MDB in Access 2003 on WS03, then making it into an MDE and deploying it on a WinXP box with Access 2003 installed, I get this error: Function is not available in expressions...
2
by: Susan Bricker | last post by:
Greetings Experts ... I have a routine that is invoked when a command button is clicked. The button is located in a form that is tied to a table of Project records. Each Project Record has 0 to...
6
by: Patrick Dugan | last post by:
Hello, I'm trying to load different images (icons) into a PictureBox1.Image. The first image loads just fine, but the second image always returns the error "Invalid property used." It doesn't...
0
by: Sean OConnor | last post by:
I have three servers, public web server (e.g. web1), file server (file1), and web services server (service1). web1 is in the DMZ and file1 and service1 are internal. I'm calling the webservices...
42
by: Martin Jørgensen | last post by:
Hi, I'm trying to move a matlab program into c language. For those who knows matlab, this is the line I want to program in c: hx(1:nx,1:ny) = 0; % nx=10, ny=10 It works on a 2-dimensional...
9
bonski
by: bonski | last post by:
hello everybody.. i just want to know what this error means... Error: mail() : SMTP server response: 501 #5.1.1 bad address the smtp set up was correct.. valid emails... and port. so im just...
1
by: McKool | last post by:
Hello Group, I'm writting a Windows Services under C# to get some USB events. Because the ServiceBase class does not supports the SERVICE_CONTROL_DEVICEEVENT handler, I'm using P/Invoke to call...
0
by: tvnaidu | last post by:
Trying to compile sqlite3 (3.6.22), getting this error "`Tcl_WideInt' undeclared", I have tcl.h was included, but still getting any idea why?. libtool: link: gcc -g -O2 -DSQLITE_OS_UNIX=1 -I....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.