Комментарии:
ah, i have a question:
we return 0 at the end of every function to signify successful execution. however, 0 means false. why then would we return 0 to signify error free execution of code?
also related:
we use the shorthand if(foo)/ if(foo==true) or if (!foo) /if(foo==false) to mean if (foo!=0) and if(foo=0). //note to self
is it possible to create a bool type from scratch?
ОтветитьIn one of your previous videos a person asked me why I used if(ture == SyncLock) in my code and not if(SyncLock) ! true can be 0 or 1 only, and assignment to true in this configuration (true is to the left side of the equation) for the wrong output to SyncLock (any number) will produce Warning or error (true = 253 produces error or warning), also using true = SyncLock is imune to error and wrong casting. This is my personal openion. Please advise if I am wrong or if you have any recommendation. Thank you Kevin.
ОтветитьQuestion, is it worth including a library just for that purpouse? because, I guess, including a library ,aka external code, waste space and resources, which makes me unsure about including a library just for that, instead of an unsigned char maybe using a typedef, thank you in advance.
ОтветитьI did not know of that library and I was continuosly getting error. Thank u for this nice explanation.
Ответитьalso bool type only use 1 byte of memory instead of 4 bytes for an int
ОтветитьHelpfull. Thanks.
ОтветитьThank you very much <3
Ответитьvery good pro :D
Ответитьbut why any other value is true?? can you you please tell me
ОтветитьThanks for the plain, simple, but excellent explanation. ❤️
Ответитьgreat breakdown
ОтветитьIs there a specifier we can use to display true / false to screen?
ОтветитьI really didn't know about this, like, I never needed to declare a boolean variable, but 4 years later I learned C that I declare a variable boolean, I get the error.
That's crazy.
Thank you I have assignment just like your video but i have one problem....how about this "=" (Boolean value True or False using <, >, =)
ОтветитьThank you for the explanation, it was really helpful :)
Ответить