{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Feb 7 - return*this Time Time:operator(cosnt Time&t...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Feb 7, 2006, ECE106 Objects with pointers Struct _time{ Int hour, minute, second; }; Class Time{ Private: Struct _time* tt; Public: ….. }; //constructor { tt=new struct _time; } //destructor { Delete tt; } Time Time::operator=(Time t){ This->tt->hour=t.tt->hour; tt->minute=t.tt->minute; tt->second=t.tt->second;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return (*this); } Time Time::operator+(cosnt Time &t) const{ Time* psum; Psum=new Time(); Return(psum); } z.operator=(x.operator+(y)); Time::Time(Time &t){ tt->hour=t.tt->hour; tt->minute=t.tt->minute; tt>second=t.tt->second; }...
View Full Document

{[ snackBarMessage ]}