Click here to Skip to main content
15,910,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFunctions and if () Question [modified] Pin
Programm3r2-Apr-07 21:50
Programm3r2-Apr-07 21:50 
AnswerRe: Functions and if () Question Pin
kakan2-Apr-07 22:02
professionalkakan2-Apr-07 22:02 
AnswerRe: Functions and if () Question Pin
CPallini2-Apr-07 22:11
mveCPallini2-Apr-07 22:11 
GeneralRe: Functions and if () Question Pin
kakan2-Apr-07 22:16
professionalkakan2-Apr-07 22:16 
GeneralRe: Functions and if () Question Pin
CPallini2-Apr-07 22:31
mveCPallini2-Apr-07 22:31 
GeneralRe: Functions and if () Question Pin
kakan2-Apr-07 22:43
professionalkakan2-Apr-07 22:43 
QuestionRe: Functions and if () Question Pin
Programm3r2-Apr-07 22:29
Programm3r2-Apr-07 22:29 
AnswerRe: Functions and if () Question Pin
kakan2-Apr-07 22:38
professionalkakan2-Apr-07 22:38 
Well...
When it comes to bool values, they are defined as this (if I remember it correctly):
false is always 0, zero.
true is any other value, can be -1 (VARIANT_BOOL) or 1 (true, TRUE).
But stricly, if it has got any other value than 0, it's true.

So if you want to follow the rules, while working with bool variables, always test for zero or not zero.
Test for zero/false:
if (!a), or if(0 == a), or if(a == 0)
Test for true:
if (a), or if(0 != a), or if(a != 0)




Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

AnswerRe: Functions and if () Question Pin
CPallini2-Apr-07 22:43
mveCPallini2-Apr-07 22:43 
GeneralRe: Functions and if () Question Pin
cp98763-Apr-07 1:35
cp98763-Apr-07 1:35 
JokeRe: Functions and if () Question Pin
Cedric Moonen2-Apr-07 22:21
Cedric Moonen2-Apr-07 22:21 
GeneralRe: Functions and if () Question Pin
CPallini2-Apr-07 22:34
mveCPallini2-Apr-07 22:34 
GeneralRe: Functions and if () Question Pin
Programm3r2-Apr-07 22:35
Programm3r2-Apr-07 22:35 
QuestionHow to get IP adress? Pin
birajendu2-Apr-07 21:35
birajendu2-Apr-07 21:35 
AnswerRe: How to get IP adress? Pin
saisp2-Apr-07 21:39
saisp2-Apr-07 21:39 
AnswerRe: How to get IP adress? Pin
Nibu babu thomas2-Apr-07 23:45
Nibu babu thomas2-Apr-07 23:45 
AnswerRe: How to get IP adress? Pin
Suresh H3-Apr-07 0:15
Suresh H3-Apr-07 0:15 
QuestionDetecting out-of-bounds in dynamic array? Pin
dontknowitall2-Apr-07 21:29
dontknowitall2-Apr-07 21:29 
AnswerRe: Detecting out-of-bounds in dynamic array? Pin
CPallini2-Apr-07 22:13
mveCPallini2-Apr-07 22:13 
GeneralRe: Detecting out-of-bounds in dynamic array? Pin
dontknowitall2-Apr-07 22:24
dontknowitall2-Apr-07 22:24 
QuestionRe: Detecting out-of-bounds in dynamic array? Pin
CPallini2-Apr-07 22:53
mveCPallini2-Apr-07 22:53 
AnswerRe: Detecting out-of-bounds in dynamic array? Pin
dontknowitall2-Apr-07 23:11
dontknowitall2-Apr-07 23:11 
GeneralRe: Detecting out-of-bounds in dynamic array? Pin
CPallini2-Apr-07 23:32
mveCPallini2-Apr-07 23:32 
AnswerRe: Detecting out-of-bounds in dynamic array? Pin
Mark Salsbery3-Apr-07 8:33
Mark Salsbery3-Apr-07 8:33 
Questiondisplay files-please help me its urgent Pin
saisp2-Apr-07 21:08
saisp2-Apr-07 21:08 

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.