Click here to Skip to main content
15,885,979 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Trying to add a menu bar to a dialog Pin
Victor Nijegorodov1-Mar-20 20:54
Victor Nijegorodov1-Mar-20 20:54 
GeneralRe: Trying to add a menu bar to a dialog Pin
ForNow2-Mar-20 0:51
ForNow2-Mar-20 0:51 
Questionlaunching Caliberate the screen for Pen or touch input C++ Pin
Member 1393286726-Feb-20 3:16
Member 1393286726-Feb-20 3:16 
AnswerRe: launching Caliberate the screen for Pen or touch input C++ Pin
Richard Deeming26-Feb-20 3:36
mveRichard Deeming26-Feb-20 3:36 
QuestionTAPI http request Pin
Djalma C. Bina24-Feb-20 17:38
Djalma C. Bina24-Feb-20 17:38 
AnswerRe: TAPI http request Pin
Richard MacCutchan24-Feb-20 23:10
mveRichard MacCutchan24-Feb-20 23:10 
QuestionTo bool or not to bool in C/C++ ? Pin
Vaclav_20-Feb-20 16:11
Vaclav_20-Feb-20 16:11 
AnswerRe: To bool or not to bool in C/C++ ? Pin
CPallini20-Feb-20 21:00
mveCPallini20-Feb-20 21:00 
Quote:
"bool" is not "standard" C/C++ type

Well... Fundamental types - cppreference.com[^], Boolean type support library - cppreference.com[^].


Quote:
thus if(condition == 0) would make better sense
then if(condition)

most "well written functions return x" , x being mostly zero when function is successful
when function fails – the return value is (generally) -1 or positive value identifying the error
then same as above - if(function (z) == 0) should prevail.

In C++, if a function returns a bool then using
C++
if ( function(x) )
is the only meaningful way I see.

On the other hand, if the function returns an integer data type, then
C++
if (function(x) == expected_int_result)
is the most sensible approach.
AnswerRe: To bool or not to bool in C/C++ ? Pin
Stephane Capo20-Feb-20 21:55
professionalStephane Capo20-Feb-20 21:55 
AnswerRe: To bool or not to bool in C/C++ ? Pin
Richard MacCutchan20-Feb-20 22:00
mveRichard MacCutchan20-Feb-20 22:00 
AnswerRe: To bool or not to bool in C/C++ ? Pin
Victor Nijegorodov20-Feb-20 22:08
Victor Nijegorodov20-Feb-20 22:08 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Vaclav_21-Feb-20 10:18
Vaclav_21-Feb-20 10:18 
GeneralRe: To bool or not to bool in C/C++ ? Pin
k505421-Feb-20 10:51
mvek505421-Feb-20 10:51 
AnswerRe: To bool or not to bool in C/C++ ? Pin
Stefan_Lang21-Feb-20 0:31
Stefan_Lang21-Feb-20 0:31 
AnswerRe: To bool or not to bool in C/C++ ? Pin
Vaclav_21-Feb-20 5:30
Vaclav_21-Feb-20 5:30 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Richard MacCutchan21-Feb-20 5:54
mveRichard MacCutchan21-Feb-20 5:54 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Vaclav_21-Feb-20 8:29
Vaclav_21-Feb-20 8:29 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Richard MacCutchan21-Feb-20 22:03
mveRichard MacCutchan21-Feb-20 22:03 
GeneralRe: To bool or not to bool in C/C++ ? Pin
k505421-Feb-20 5:56
mvek505421-Feb-20 5:56 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Richard MacCutchan21-Feb-20 6:07
mveRichard MacCutchan21-Feb-20 6:07 
GeneralRe: To bool or not to bool in C/C++ ? Pin
k505421-Feb-20 6:16
mvek505421-Feb-20 6:16 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Richard MacCutchan21-Feb-20 6:18
mveRichard MacCutchan21-Feb-20 6:18 
GeneralRe: To bool or not to bool in C/C++ ? Pin
Vaclav_21-Feb-20 8:25
Vaclav_21-Feb-20 8:25 
GeneralRe: To bool or not to bool in C/C++ ? Pin
k505421-Feb-20 9:31
mvek505421-Feb-20 9:31 
AnswerRe: To bool or not to bool in C/C++ ? Pin
leon de boer21-Feb-20 11:55
leon de boer21-Feb-20 11:55 

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.