Click here to Skip to main content
16,005,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMACROS Pin
big_denny_20014-Feb-06 22:48
big_denny_20014-Feb-06 22:48 
AnswerRe: MACROS Pin
toxcct14-Feb-06 22:55
toxcct14-Feb-06 22:55 
GeneralRe: MACROS Pin
sunit514-Feb-06 23:08
sunit514-Feb-06 23:08 
GeneralRe: MACROS Pin
toxcct14-Feb-06 23:11
toxcct14-Feb-06 23:11 
GeneralRe: MACROS Pin
sunit514-Feb-06 23:15
sunit514-Feb-06 23:15 
GeneralRe: MACROS Pin
Rage15-Feb-06 0:21
professionalRage15-Feb-06 0:21 
GeneralRe: MACROS Pin
Nemanja Trifunovic15-Feb-06 7:47
Nemanja Trifunovic15-Feb-06 7:47 
AnswerRe: MACROS Pin
James R. Twine15-Feb-06 5:29
James R. Twine15-Feb-06 5:29 
sunit5 wrote:
what I know #ifdef #endif and pragma once functionality is different
#pragma once maintains a "include file table" for include files during compilation . But their work is same


   Almost - #pragma once prevents the entire file from being brought in by the preprocessor again.  The #ifndef/#define/#endif or #if !defined/#define/#endif constructs exclude a specific range (whatever is enclosed in the #ifndef block) from being brought in again.  Anything before or after the block would be brought in again.

   However, the common/general use of the latter makes it pretty much the same functionality as #pragma once, but it is incorrect to assume that they both do the exact same thing.

   For example, place something like DWORD Some_Value outside of the #ifndef block of a header file and #include the file twice in a CPP file somewhere and compile that CPP file.  You will get an error about a redefinition.  Now, add #pragma once to the header file and
try to compile the CPP file again; the error will go away.

   Lastly, #pragma constructs are compiler-dependent - but that does not mean that different compilers will not use the same #pragmas for the same thing (or even different things).

   Peace!

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites
(Please rate this post!)
AnswerRe: MACROS Pin
khan++14-Feb-06 22:56
khan++14-Feb-06 22:56 
AnswerRe: MACROS Pin
ThatsAlok14-Feb-06 23:34
ThatsAlok14-Feb-06 23:34 
AnswerRe: MACROS Pin
Gavin Taylor14-Feb-06 23:40
professionalGavin Taylor14-Feb-06 23:40 
QuestionCString Pin
Tony Kurishunkal14-Feb-06 22:06
Tony Kurishunkal14-Feb-06 22:06 
AnswerRe: CString Pin
toxcct14-Feb-06 22:09
toxcct14-Feb-06 22:09 
AnswerRe: CString Pin
khan++14-Feb-06 22:12
khan++14-Feb-06 22:12 
AnswerRe: CString Pin
ThatsAlok14-Feb-06 22:48
ThatsAlok14-Feb-06 22:48 
GeneralRe: CString Pin
Rob Caldecott14-Feb-06 23:38
Rob Caldecott14-Feb-06 23:38 
GeneralRe: CString Pin
ThatsAlok14-Feb-06 23:58
ThatsAlok14-Feb-06 23:58 
GeneralRe: CString Pin
Chintoo72315-Feb-06 2:15
Chintoo72315-Feb-06 2:15 
QuestionRe: CString Pin
David Crow15-Feb-06 3:55
David Crow15-Feb-06 3:55 
AnswerRe: CString Pin
James R. Twine15-Feb-06 7:02
James R. Twine15-Feb-06 7:02 
QuestionHelp in Remote Desktop Applications akka. VNC Pin
Girish60114-Feb-06 21:02
Girish60114-Feb-06 21:02 
GeneralRe: Help in Remote Desktop Applications akka. VNC Pin
Malli_S14-Feb-06 21:56
Malli_S14-Feb-06 21:56 
GeneralRe: Help in Remote Desktop Applications akka. VNC Pin
ThatsAlok14-Feb-06 22:46
ThatsAlok14-Feb-06 22:46 
GeneralRe: Help in Remote Desktop Applications akka. VNC Pin
Girish60114-Feb-06 22:53
Girish60114-Feb-06 22:53 
QuestionWhy my "i" counter doesn't increases? Pin
Rassul Yunussov14-Feb-06 20:56
Rassul Yunussov14-Feb-06 20:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.