[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Do you #include <stdbool.h> or #define TRUE 1 #define
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 29
Thread images: 3
File: unnamed.png (19 KB, 300x300) Image search: [Google]
unnamed.png
19 KB, 300x300
Do you
#include <stdbool.h>

or
#define TRUE 1
#define FALSE 0
typedef int bool;

or just let it be and use 0 and 1 and ints directly?
>>
>>55038171
I stop being retarded, m9
>>
>>55038184
Explain
>>
>>55038203
I don't teach pajeets
>>
>>55038171

typedef enum {true, false} bool;

or plain unsigned chars or ints.. unless you need to serialize and/or size matters. Allows you to have more states if you like.
>>
>>55038171
Neither, I use c99 because I can
>>
>>55038584
So?
>>
>>55038171
You
#include <stdbool.h>
>>
>>55038171
both are wrong you faggot
>>
>typedef int bool
>int
Disgusting.
>>
#include <stdbool.h>
>>
>>55038771
char is slower
>>
File: why2.jpg (35 KB, 347x304) Image search: [Google]
why2.jpg
35 KB, 347x304
>>55038171
>c
>2016

sure if it makes you feel smarter having to re-implement true or false in every project
>>
>>55038171
I use Rust
>>
>>55038171
neither

typedef enum {false = 0, true = 1} boolean;
>>
File: c_for_cucks.png (200 KB, 840x1050) Image search: [Google]
c_for_cucks.png
200 KB, 840x1050
>>
>>55039097
contestant 1
>>
>>55038171
just use ints and return 1 for true, 0 for false
If you're stupid enough to use C, there's no point in trying to act smart about it.
>>
>>55039097
conestant 4
>>
>>55039097
2?
>>
>>55039097
2
>>
>>55039097
contestant 2 cause it points to [0]
>>
>>55039097
Undefined behavior
>>
Friendly reminder to always
#define TRUE FALSE
>>
>>55039097
2
>>
>>55039097
Black boy, white girl.
>>
>>55039097
2 because she's obviously a coal burner
>>
>>55038171
>or just let it be and use 0 and 1 and ints directly?
this. technically zero and nonzero, not zero and one. less verbose and anyone smart enough to read or write C understands it.
>>
>>55039097

And that's why C sucks, kids.
Thread replies: 29
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.