Teen Programmers Unite  


Return to forum top

C++ supreme newbie question

Posted by diegoeskryptic [send private reply] at April 18, 2002, 05:21:38 PM

There is an error in here sumwhere but I just cant seem to find it: void printBill(int num_of_days, double room_cost, const double &telephone_charge, const double &television_charge, double totalDue){.... Here's what the error says:

E:\vcpp\Hospital\hospital.cpp(98) : error C2601: 'printBill' : local function definitions are illegal... I've checked this program over and over to make sure all the variables were in the right place but i still cant fix the problem.... please help me!

Posted by Psion [send private reply] at April 18, 2002, 08:52:39 PM

The great thing about error messages is that they tell you what you've done wrong. This one tells you that you are trying to define a function inside another function, which is not allowed. If you don't think you're trying to do this, then check for missing/extra {}'s, etc..

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.