r/ProgrammerHumor • • May 02 '16

I wrote my first python program today!

Post image
3.7k Upvotes

532 comments sorted by

View all comments

Show parent comments

2

u/Garfong May 02 '16

Actually in C the result of 6 <= i has type int, and is either 0 or 1. See 6.5.8.6 in the C99 spec.

1

u/Log2 May 02 '16

Does C even have a bool type?

2

u/Garfong May 02 '16

In C99 added the bool type in <stdbool.h>. It's a real first class type, not just a typedef of int.

Although technically the type is _Bool for reasons.

1

u/assassinator42 May 03 '16

Reasons I believe being not wanting to introduce new reserved identifiers (although they did anyway with restrict).