473,729 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

7 New Member
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 15625
Banfa
9,065 Recognized Expert Moderator Expert
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<iostre am.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
9539
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 in query expression SELECT IIf(IsNull(),"", & Chr(13) & Char(10)) & IIf(IsNull(),"", & Char(13) & Char(10)) & IIf(IsNull(),"", & Char(13) & Char(10)) & IIf(IsNull(),"",] & IIf(IsNull(),"",", ") &
2
1914
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 many Task Records associated with it (in another table). I want to 'logically remove' the Project Record and all Task Records for the Project (by setting the field in each of those records to 'true'). Here is the problem ... in the routine I...
6
2144
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 matter what icons are loaded. The first always shows up and any icons after that give me the error. Here is the offending code: The "DestinationPath" variable is the full path and filename of the icon
0
1567
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 from an ASP page using the Microsoft SOAP Toolkit 2.0. I'm seting impersonation in my web.config using an service account that has the appropriate permissions. When I call the services from an ASP page on service1 everything works correctly. However,...
42
3150
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 array (size is 10*10), setting all the values inside the 10*10 matrix to zero. My C-function looks like this:
9
14058
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 wondering why this error still occurs. looking forward for your suggestions.. thanks!
1
5264
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 the RegisterServiceCtrlHandlerEx funtion, using a callback to manage the needed handler. The invoke looks ok, it works. The problem is when the services stops. My callback function receives the SERVICE_CONTROL_STOP handler but the function don't...
0
1971
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. -I../sqlite-3.6.22/src -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DHAVE_READLINE=1 -I/usr/include/readline -o .libs/sqlite3 ../sqlite-3.6.22/src/shell.c ./.libs/libsqlite3.so...
0
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.