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

Do you #include <stdbool.h> or #define TRUE 1 #define

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 29
Thread images: 3

File: unnamed.png (19KB, 300x300px) Image search: [Google]
unnamed.png
19KB, 300x300px
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 (35KB, 347x304px) Image search: [Google]
why2.jpg
35KB, 347x304px
>>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 (200KB, 840x1050px) Image search: [Google]
c_for_cucks.png
200KB, 840x1050px
>>
>>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 posts: 29
Thread images: 3


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.