Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Necuima

Scripts 12.1, 12.2 And 12.3

Recommended Posts

Hi Larry,

 

I have loaded these 3 scripts into my Dev-C++ IDE and they work just fine.  But I don't understand how main.cpp 'knows' about Rational.cpp; there doesn't seem to be any direct reference to it either from main.cpp or Rational.h.

 

Also, I had to add <stdlib.h> to Rational.cpp to cater for the abs (absolute value) bit in the 'normalize' method.

 

Any enlightenment will be most appreciated and thank you in anticipation.

 

Cheers from Oz.

 

 

Share this post


Link to post
Share on other sites

Good question! Rational.cpp is compiled along with main.cpp to create the binary. This is how main.cpp has access to its contents. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...