Is anyone here who really can explain me how “boolean” work?
And please give me some example if you can!!!
Thanks!
ThePolitician
And please give me some example if you can!!!
Thanks!
ThePolitician
|
C
C++ boolean types .... |
|
Nov 19, 2018 09:16 PM
(This post was last modified: Nov 19, 2018 09:17 PM by 0xDEAD10CC.)
Code if (this.thread == a_joke)?
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Nov 20, 2018 10:15 AM
(This post was last modified: Nov 20, 2018 10:20 AM by iTHX.)
if (5+5==10){
return true; } else { return false; } // if used productively then its used like this... int main(){ int age; bool isAble = false // able to drive initially false cout << "Age :" << endl; cin age; if (age >= 17){ isAble = true; } else if (age < 17){ isAble = false; } while(isAble){ cout << endl << "user is able to drive"; } while(!isAble){ cout << endl << "user unable to drive"; } return 0; }
Nov 20, 2018 10:22 AM
(This post was last modified: Nov 20, 2018 10:23 AM by 0xDEAD10CC.)
(Nov 20, 2018 10:15 AM)iTHX Wrote: if (5+5==10){ I don't see how that is productive because the expressions are bools too. Not sure what the while loops are for, they won't terminate by themselves. You also over-complicated a simple if-else statement.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] (Nov 20, 2018 10:22 AM)0xDEAD10CC Wrote: I don't see how that is productive because the expressions are bools too. Not sure what the while loops are for, they won't terminate by themselves. You also over-complicated a simple if-else statement. i understand your point, i was just trying to find an excuse to use them in a basic, understandable program. i can do much better than this |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| by HackersApr 29, 2024 05:37 AM | 27 | 475 |
Apr 29, 2024 05:37 AM Last Post: nucleo_type09 |
| [.NET] by MankOct 4, 2020 07:53 PM | 3 | 147 |
Oct 4, 2020 07:53 PM Last Post: Mank |
| [.NET] by Mr ReddingtonSep 2, 2016 02:41 PM | 6 | 158 |
Sep 2, 2016 02:41 PM Last Post: Mr Reddington |