Click here to Skip to main content
15,925,602 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString problem Pin
FlyingDancer29-Jun-03 19:06
FlyingDancer29-Jun-03 19:06 
GeneralRe: CString problem Pin
Michael Dunn29-Jun-03 19:41
sitebuilderMichael Dunn29-Jun-03 19:41 
GeneralRe: CString problem Pin
FlyingDancer30-Jun-03 3:43
FlyingDancer30-Jun-03 3:43 
GeneralA general solution Pin
Trollslayer30-Jun-03 1:45
mentorTrollslayer30-Jun-03 1:45 
GeneralProblem using Flat Scroll Bars Pin
miguel.lopes@lsi.pt29-Jun-03 7:03
sussmiguel.lopes@lsi.pt29-Jun-03 7:03 
GeneralRepeating socket connection Pin
Anonymous29-Jun-03 3:20
Anonymous29-Jun-03 3:20 
GeneralRe: Repeating socket connection Pin
valikac29-Jun-03 6:24
valikac29-Jun-03 6:24 
GeneralComparing BOOL values Pin
Abin29-Jun-03 2:54
Abin29-Jun-03 2:54 
Sometimes I need to compare two boolean values, for example:

BOOL b1 = condition1();
BOOL b2 = condition2();

if (b1 == b2) // both TRUE or both FALSE
{
// something
}
else
{
// something else
}

Above code makes sense but actually I guess they are wrong, since BOOL's are actually INT's, while "false" is guaranteed to be "0", "true" is only guaranteed to be "non-zero" ---- in theory, it may or may not be "1", so even if b1 and b2 are both true, they don't necessarily equal to each other.
Although I can do this instead:

if ((b1 && b2) || (!b1 && !b2))
{
// something
}
else
{
// something else
}

This sure will work but looks ugly, my question is, how to compare two BOOL values in a way that the code works AND looks not ugly?
GeneralRe: Comparing BOOL values Pin
Nick Parker29-Jun-03 2:58
protectorNick Parker29-Jun-03 2:58 
GeneralRe: Comparing BOOL values Pin
Angel Kid29-Jun-03 3:00
Angel Kid29-Jun-03 3:00 
GeneralRe: Comparing BOOL values Pin
Tibor Blazko29-Jun-03 4:12
Tibor Blazko29-Jun-03 4:12 
GeneralRe: Comparing BOOL values Pin
Ryan Binns29-Jun-03 4:31
Ryan Binns29-Jun-03 4:31 
GeneralRe: Comparing BOOL values Pin
Anonymous29-Jun-03 7:46
Anonymous29-Jun-03 7:46 
GeneralRe: Comparing BOOL values Pin
Ravi Bhavnani29-Jun-03 8:39
professionalRavi Bhavnani29-Jun-03 8:39 
GeneralRe: Comparing BOOL values Pin
Anders Molin29-Jun-03 9:48
professionalAnders Molin29-Jun-03 9:48 
GeneralRe: Comparing BOOL values Pin
Chris Richardson29-Jun-03 12:24
Chris Richardson29-Jun-03 12:24 
GeneralCString::SetAt Pin
Sunnygirl29-Jun-03 2:53
Sunnygirl29-Jun-03 2:53 
GeneralRe: CString::SetAt Pin
zeki yugnak29-Jun-03 3:52
zeki yugnak29-Jun-03 3:52 
GeneralRe: CString::SetAt Pin
Abbas_Riazi29-Jun-03 3:55
professionalAbbas_Riazi29-Jun-03 3:55 
GeneralRe: CString::SetAt Pin
Ryan Binns29-Jun-03 4:34
Ryan Binns29-Jun-03 4:34 
GeneralRe: CString::SetAt Pin
MAAK29-Jun-03 11:41
MAAK29-Jun-03 11:41 
GeneralTransmit files by Serial Ports Pin
Angel Kid29-Jun-03 2:14
Angel Kid29-Jun-03 2:14 
GeneralRe: Transmit files by Serial Ports Pin
Abbas_Riazi29-Jun-03 3:50
professionalAbbas_Riazi29-Jun-03 3:50 
GeneralRe: Transmit files by Serial Ports Pin
Ted Ferenc29-Jun-03 7:30
Ted Ferenc29-Jun-03 7:30 
GeneralModal CFrameWnd Pin
pranavamhari29-Jun-03 1:26
pranavamhari29-Jun-03 1:26 

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.