Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionif(NULL == MyPointer) Pin
User 5838527-Nov-11 15:37
User 5838527-Nov-11 15:37 
AnswerRe: if(NULL == MyPointer) Pin
Dr.Walt Fair, PE7-Nov-11 15:45
professionalDr.Walt Fair, PE7-Nov-11 15:45 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole7-Nov-11 17:43
Chuck O'Toole7-Nov-11 17:43 
AnswerRe: if(NULL == MyPointer) Pin
«_Superman_»7-Nov-11 18:08
professional«_Superman_»7-Nov-11 18:08 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:46
Stefan_Lang10-Nov-11 3:46 
AnswerRe: if(NULL == MyPointer) Pin
Malli_S8-Nov-11 1:05
Malli_S8-Nov-11 1:05 
AnswerRe: if(NULL == MyPointer) Pin
Eytukan8-Nov-11 7:36
Eytukan8-Nov-11 7:36 
GeneralRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 8:39
Chuck O'Toole8-Nov-11 8:39 
Ha, I have the opposite problem.

If the variable is decleared to be bool (C++) or BOOL (C/Microsoft) then I don't mind the if (bCondition) or even if (!bCondition). What kills me is if the variable is an int or similar and that short cut is used just because it evaluates to a zero/non-zero test. Damnit, write:
C++
if (iVar != 0)
or
C++
if (iVAR == 0)
if that's what you're testing for and don't use the "boolean variable" if notation.
C++
if (!iVar)
to mean "if iVar is equal to zero" just drives me crazy.
GeneralRe: if(NULL == MyPointer) Pin
David Crow8-Nov-11 8:44
David Crow8-Nov-11 8:44 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:54
Stefan_Lang10-Nov-11 3:54 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:03
Eytukan10-Nov-11 17:03 
GeneralRe: if(NULL == MyPointer) Pin
User 5838528-Nov-11 11:12
User 5838528-Nov-11 11:12 
AnswerRe: if(NULL == MyPointer) Pin
Chuck O'Toole8-Nov-11 11:55
Chuck O'Toole8-Nov-11 11:55 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:05
Eytukan10-Nov-11 17:05 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:52
Stefan_Lang10-Nov-11 3:52 
AnswerRe: if(NULL == MyPointer) Pin
Dave Doknjas8-Nov-11 9:51
Dave Doknjas8-Nov-11 9:51 
GeneralRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:38
Stefan_Lang10-Nov-11 3:38 
GeneralRe: if(NULL == MyPointer) Pin
Eytukan10-Nov-11 17:01
Eytukan10-Nov-11 17:01 
AnswerRe: if(NULL == MyPointer) Pin
jschell8-Nov-11 10:03
jschell8-Nov-11 10:03 
AnswerRe: if(NULL == MyPointer) Pin
Stefan_Lang10-Nov-11 3:25
Stefan_Lang10-Nov-11 3:25 
Questionsetup with active x Pin
antonio3437-Nov-11 13:52
antonio3437-Nov-11 13:52 
AnswerRe: setup with active x Pin
Chandrasekharan P7-Nov-11 19:15
Chandrasekharan P7-Nov-11 19:15 
GeneralRe: setup with active x Pin
antonio3437-Nov-11 21:41
antonio3437-Nov-11 21:41 
AnswerRe: setup with active x Pin
Malli_S8-Nov-11 1:17
Malli_S8-Nov-11 1:17 
AnswerRe: setup with active x Pin
Eytukan8-Nov-11 7:53
Eytukan8-Nov-11 7:53 

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.