RSS Forums RSS
Please support our C++ advertiser: Programming Forums

Help with Classes !!! (Homework)

Join Date: Feb 2005
Posts: 464
Reputation: winbatch is on a distinguished road 
Rep Power: 4
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: Help with Classes !!! (Homework)

  #10  
Jul 24th, 2005
A couple of issues:


int main(); should be int main() (no ;)

myDay.printDay() const; should be myDay.printDay();
You can't do this:
cout << myDay.printDay() << endl;

because printDay() does not return anything (it returns void)

Also,

You'll end up with some kind of endless loop/recursion here as you are calling your self inside:
void dayType::printDay() const
{
cout << "The day is: " << dayofweek << endl;
printDay();
}
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:37 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC