954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

link list holding objects

Hello,

For easy to use I've uploaded the code as a zip. Basically it compiles but everytime I push something onto the linklist, it doesnt want to go. I know this since when i get to the print function it prints '15' '15'. instead of the date objects defined in main.

could you have a look and highlight any changes?

Cheers,

Attachments OOPLL.zip (1.67KB)
Acidburn
Posting Pro
511 posts since Dec 2004
Reputation Points: 12
Solved Threads: 5
 
Date::Date()
{
	day = 15;
	month = 03;
	year = 4;
}

Date::Date(int d, int m, int y)
{
	day = d;
	month = m;
	year = y;
}

->

Date(int d = 15, int m = 3, int y = 5)
//...
Date::Date(int d, int m, int y) : day(d), month(m), year(y)
{
}

03 is octal, although in this case it doesn't matter.

dwks
Posting Whiz in Training
269 posts since Nov 2005
Reputation Points: 185
Solved Threads: 28
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You