RE: [Dev-C++] problem calling functions
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: James G. <Jam...@Cl...> - 2001-01-16 13:39:42
|
Your function calls don't have () on the end. Even if you do not pass parameters to functions you must include empty () when calling the functions. The deceleration of inpu doesn't pass parameters but the definition requires an int. Regards, James. -----Original Message----- From: jag [mailto:won...@th...] Sent: Tuesday, January 16, 2001 11:33 AM To: devc++ mail-list Subject: [Dev-C++] problem calling functions ----------------------------------------------------- This email was delivered to you by the Free Internet, a Business Online Group company. Join TFI at http://www.thefreeinternet.net - the UK's premier 0800, free access ISP. ----------------------------------------------------- Hi, can anyone tell me where i'm going wrong with my coding? The code is at the end of the email. It's a simple program to practice function calls. I want to enter either a number 1 or number 2 to call seperate functions. When the functions are called it prints a simple message to say that the function has been successfully called, i can n't get the program to call the functions however! Can anyone advise me why? thanks in advance jag. #include <stdio.h> #include <iostream.h> int again; int enteb; void outpu(void); void inpu(void); int main(int argc, char *argv[]) { cout <<"monkey type (1) for function outpu (1) or (2) for function inpu"; cin >>enteb; if (enteb == 1) { outpu; } if (enteb == 2) { inpu; } cout <<"neither 1 or 2\n"; cout <<"wait for a number and enter pressed"; cin >> again; return 0; } void outpu(void) { cout <<"calling function outpu "<<enteb; } void inpu(int enteb) { cout <<"calling function inpu "<<enteb; } ICQ #103968172 _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/lists/listinfo/dev-cpp-users * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This electronic message and any attachment is intended to be read by the named addressee(s) only. Any other recipient should be aware that its contents may be legally privileged and/or confidential and that its use, disclosure, copying or distribution may be unlawful. Unless you are a named addressee, please delete this message Whilst C. & J. Clark International Limited has taken steps to prevent the transmission of computer viruses with electronic mail, responsibility for screening incoming messages and the risk of such transmission and its consequences lies with the recipient. C. & J. Clark International Limited Registered in England and Wales Company No. 141015 Registered Office: 40 High Street, Street, Somerset BA16 0YA Telephone: +44 (0) 1458 443131 Fax: +44 (0) 1458 447547 |