Feb 7 - return (*this); } Time Time::operator+(cosnt Time...

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 DocumentRight 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

This note was uploaded on 04/17/2008 for the course ECE ECE106 taught by Professor Abdelrahman during the Spring '08 term at University of Toronto- Toronto.

Page1 / 2

Feb 7 - return (*this); } Time Time::operator+(cosnt Time...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online