Thread: C++ Arrays
View Single Post
Old 11-09-2006, 03:07 PM   #14 (permalink)
milt
Forum Expert
 
milt's Avatar
 
Join Date: Nov 2003
Location: Lancaster, PA
Age: 20
Posts: 1,606
Send a message via AIM to milt Send a message via Yahoo to milt Send a message via Skype™ to milt
Default

Okay, so basically I'm stuck with this?

Code:
class Calendar
{
public:
	int year;
	int month;
	Month *months;

	Calendar()
	{
		months = new Month[12];

		months[0] = Month("January", 31);
		months[1] = Month("February", 28);
		months[2] = Month("March", 31);
		months[3] = Month("April", 30);
		months[4] = Month("May", 31);
		months[5] = Month("June", 30);
		months[6] = Month("July", 31);
		months[7] = Month("August", 31);
		months[8] = Month("September", 30);
		months[9] = Month("October", 31);
		months[10] = Month("November", 30);
		months[11] = Month("December", 31);
	}

	~Calendar()
	{
		delete [] months;
	}
}
__________________
--Milt, AKA Pokey
milt is offline   Reply With Quote