Jump to content



Photo

Script 7.6 - Rectangles5.cpp

constructor method

  • Please log in to reply
2 replies to this topic

#1 Necuima

Necuima

    Advanced Member

  • Members
  • PipPipPip
  • 233 posts
  • LocationSunshine Coast, Queensland, Australia

Posted 23 April 2015 - 2:36 AM

Hi Larry,

 

I have been working through the book and am at script 7.6 - rectangles5.cpp.

 

Because of the constructor, I found that the setSize method is no longer needed as the constructor does the same job.

 

I commented out all references to the setSize method and the application executes correctly in my Dev-C++ IDE.

 

FYI, Cheers from Oz.


  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 25 April 2015 - 7:52 AM

Thanks for reporting that! I'll confirm it and get it fixed. 


  • 0

#3 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 8 February 2016 - 1:02 PM

(Catching up with waaaaay toooo old forum threads that I've been "watching"...) The setSize() method isn't needed to initially set a rectangle's size, but is something I would keep in there in order to resize an existing rectangle. 


  • 0





Also tagged with one or more of these keywords: constructor, method