| | |
C++ Header Help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
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...".
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
Join Date: Jul 2008
Posts: 13
Reputation:
Solved Threads: 0
Cool. Thanks for the info links. But I just have one more question. It was mentioned that But in the code that I got from n.aggel, there was #define HEADER_H. That's only one symbol, right? Or is it?
•
•
•
•
#define 'new symbol' 'previously known symbol' will make 'new symbol' and 'previously known symbol' look the same to the compiler.
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
file2.cpp
file1.h
C++ Syntax (Toggle Plain Text)
#ifndef FILE_1 #define FILE_1 //the symbol FILE_1 now has a status of being defined, though it has no value //class and function declarations, etc. #endif
file2.cpp
C++ Syntax (Toggle Plain Text)
//FILE_1 not defined #include "file1.h"//code executed //FILE_1 defined #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...".
![]() |
Similar Threads
- PHP-Nuke Tutorial #1: Altering the Header Tags (PHP)
- Html header of a page changed programmatically? (ASP.NET)
- New header (DaniWeb Community Feedback)
- How to write a header file (C++)
- c vs h header files... (C)
- missing function header (C++)
Other Threads in the C++ Forum
- Previous Thread: ifstream
- Next Thread: Code Speed Question
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






