C++ Header Help

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 401
Reputation: CoolGamer48 is on a distinguished road 
Solved Threads: 40
CoolGamer48's Avatar
CoolGamer48 CoolGamer48 is offline Offline
Posting Pro in Training

Re: C++ Header Help

 
0
  #11
Jul 29th, 2008
Originally Posted by Aia View Post
Look here
I once read an article that said to use cin.get(). What's wrong with that?
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: C++ Header Help

 
0
  #12
Jul 29th, 2008
Originally Posted by Aia View Post
Originally Posted by DanDaMan View Post
Now I'm really confused. When I don't include system("PAUSE"); then the console screen just pops up and instantly disappears.
Look here
Or, to keep it on site, look here.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 13
Reputation: DanDaMan is an unknown quantity at this point 
Solved Threads: 0
DanDaMan DanDaMan is offline Offline
Newbie Poster

Re: C++ Header Help

 
0
  #13
Jul 30th, 2008
Cool. Thanks for the info links. But I just have one more question. It was mentioned that
#define 'new symbol' 'previously known symbol' will make 'new symbol' and 'previously known symbol' look the same to the compiler.
But in the code that I got from n.aggel, there was #define HEADER_H. That's only one symbol, right? Or is it?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 401
Reputation: CoolGamer48 is on a distinguished road 
Solved Threads: 40
CoolGamer48's Avatar
CoolGamer48 CoolGamer48 is offline Offline
Posting Pro in Training

Re: C++ Header Help

 
0
  #14
Jul 30th, 2008
As was mentioned in one of the links, you can #define something with no value. The only real use for this is to use the symbol in preprocessor if-statements. One example is the #ifndef code blocks that sparked this discussion.

file1.h
  1. #ifndef FILE_1
  2. #define FILE_1
  3. //the symbol FILE_1 now has a status of being defined, though it has no value
  4.  
  5. //class and function declarations, etc.
  6. #endif

file2.cpp
  1. //FILE_1 not defined
  2. #include "file1.h"//code executed
  3. //FILE_1 defined
  4. #include "file1.h"//code not executed twice
I'm a student. If my statements seem too absolute, feel free to coat them with "In my opinion..." or "I believe...".
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 13
Reputation: DanDaMan is an unknown quantity at this point 
Solved Threads: 0
DanDaMan DanDaMan is offline Offline
Newbie Poster

Re: C++ Header Help

 
0
  #15
Jul 30th, 2008
Thanks.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC