GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #11  
Old 18-Jun-2004, 18:39
machinated machinated is offline
Regular Member
 
Join Date: Mar 2004
Location: victoria, canada
Posts: 324
machinated has a spectacular aura aboutmachinated has a spectacular aura about
i think waltp pointed the same thing out in a previous post last week or so: your declarations go in .h files. All your definitions go in .cpp files.
__________________
spasms!!!
  #12  
Old 18-Jun-2004, 18:44
pablowablo pablowablo is offline
New Member
 
Join Date: Apr 2004
Posts: 24
pablowablo is on a distinguished road
Quote:
Originally Posted by machinated
i think waltp pointed the same thing out in a previous post last week or so: your declarations go in .h files. All your definitions go in .cpp files.


I see, thanks!

Is it just good programming practice or is it a necessary thing?

Hmmm I think I need to know how compilation is done in C++.... How does the header files know that the definitions are in a particular cpp file? Does it seek every file that includes it?
  #13  
Old 18-Jun-2004, 21:05
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by machinated
i think waltp pointed the same thing out in a previous post last week or so: your declarations go in .h files. All your definitions go in .cpp files.
Yes I did...

Quote:
Originally Posted by pablowablo
I see, thanks!

Is it just good programming practice or is it a necessary thing?
Lets see now... When you get errors, what does that tell you? Just a good idea or Necessary?
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #14  
Old 18-Jun-2004, 23:00
machinated machinated is offline
Regular Member
 
Join Date: Mar 2004
Location: victoria, canada
Posts: 324
machinated has a spectacular aura aboutmachinated has a spectacular aura about
Quote:
Originally Posted by pablowablo
I see, thanks!

Is it just good programming practice or is it a necessary thing?

Hmmm I think I need to know how compilation is done in C++.... How does the header files know that the definitions are in a particular cpp file? Does it seek every file that includes it?

cpp file includes h file. cpp gets compiled into an object file. main gets compiled into an object file. then main and cpp file get linked and turn into an executable.
__________________
spasms!!!
  #15  
Old 19-Jun-2004, 11:00
pablowablo pablowablo is offline
New Member
 
Join Date: Apr 2004
Posts: 24
pablowablo is on a distinguished road
Quote:
Originally Posted by machinated
cpp file includes h file. cpp gets compiled into an object file. main gets compiled into an object file. then main and cpp file get linked and turn into an executable.

Ahhhh that makes sense, thanks!
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Operator Overloading: << aaroncohn C++ Forum 36 07-Dec-2004 20:22
Hmm what seems to be the problem here? error C2061: syntax error pablowablo C++ Forum 5 12-Jun-2004 23:11
OpenGL always reports error mvt OpenGL Programming 2 04-Jun-2004 07:42
Visual C++ 6 Compiler error vip3r C++ Forum 2 13-Apr-2004 15:34
[script] E-mail webmaster error page BobbyDouglas PHP Code Library 0 19-Aug-2003 21:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:08.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.