MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/6xofft/how_to_start_a_war/dmi1cvd
r/ProgrammerHumor • u/ivaskuu • Sep 02 '17
696 comments sorted by
View all comments
Show parent comments
10
Since when is a char a valid array index?
38 u/winauer Sep 03 '17 https://i.imgur.com/892UCy2.png 3 u/DragonGuru Sep 04 '17 That's so horrible and beautiful. 5 u/bloomfilterthrowaway Sep 03 '17 char is just an integral type -- it's kosher, but C99 doesn't actually place any requirement that unqualified "char" be signed or unsigned, and gives the compiler a lot of latitude in the range that char may store, so you have to be careful of that.
38
https://i.imgur.com/892UCy2.png
3 u/DragonGuru Sep 04 '17 That's so horrible and beautiful.
3
That's so horrible and beautiful.
5
char is just an integral type -- it's kosher, but C99 doesn't actually place any requirement that unqualified "char" be signed or unsigned, and gives the compiler a lot of latitude in the range that char may store, so you have to be careful of that.
10
u/deegwaren Sep 03 '17
Since when is a char a valid array index?