943,948 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2587
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jul 29th, 2008
0

Re: C++ Header Help

Click to Expand / Collapse  Quote originally posted by Aia ...
Look here
I once read an article that said to use cin.get(). What's wrong with that?
Reputation Points: 77
Solved Threads: 40
Posting Pro in Training
CoolGamer48 is offline Offline
401 posts
since Jan 2008
Jul 29th, 2008
0

Re: C++ Header Help

Click to Expand / Collapse  Quote originally posted by Aia ...
Click to Expand / Collapse  Quote originally posted by DanDaMan ...
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.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,741 posts
since May 2006
Jul 30th, 2008
0

Re: C++ Header Help

Cool. Thanks for the info links. But I just have one more question. It was mentioned that
Quote ...
#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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DanDaMan is offline Offline
13 posts
since Jul 2008
Jul 30th, 2008
0

Re: C++ Header Help

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
C++ Syntax (Toggle Plain Text)
  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
C++ Syntax (Toggle Plain Text)
  1. //FILE_1 not defined
  2. #include "file1.h"//code executed
  3. //FILE_1 defined
  4. #include "file1.h"//code not executed twice
Reputation Points: 77
Solved Threads: 40
Posting Pro in Training
CoolGamer48 is offline Offline
401 posts
since Jan 2008
Jul 30th, 2008
0

Re: C++ Header Help

Thanks.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DanDaMan is offline Offline
13 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: ifstream
Next Thread in C++ Forum Timeline: Code Speed Question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC