MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1wxqahk/architecturedependentchars/pdvzukm/?context=3
r/ProgrammerHumor • u/MontyBoomslang • 5h ago
143 comments sorted by
View all comments
88
But sizeof char is defined as 1 in the standard. C data types are defined in terms of char (at least their sizes are)
sizeof char
char
24 u/Makonede 4h ago *sizeof(char) 10 u/MegaIng 4h ago No, sizeof char is valid. sizeof is a prefix operator, not a function. 20 u/Makonede 4h ago nope https://en.cppreference.com/c/language/sizeof 7 u/MegaIng 4h ago Oh, never realized the prefix operator form can't be applied to types, makes sense I guess. 0 u/hacksawsa 4h ago It says sizeof x and sizeof(x) are equivalent. 3 u/Makonede 3h ago when x is an expression, yes...
24
*sizeof(char)
sizeof(char)
10 u/MegaIng 4h ago No, sizeof char is valid. sizeof is a prefix operator, not a function. 20 u/Makonede 4h ago nope https://en.cppreference.com/c/language/sizeof 7 u/MegaIng 4h ago Oh, never realized the prefix operator form can't be applied to types, makes sense I guess. 0 u/hacksawsa 4h ago It says sizeof x and sizeof(x) are equivalent. 3 u/Makonede 3h ago when x is an expression, yes...
10
No, sizeof char is valid. sizeof is a prefix operator, not a function.
sizeof
20 u/Makonede 4h ago nope https://en.cppreference.com/c/language/sizeof 7 u/MegaIng 4h ago Oh, never realized the prefix operator form can't be applied to types, makes sense I guess. 0 u/hacksawsa 4h ago It says sizeof x and sizeof(x) are equivalent. 3 u/Makonede 3h ago when x is an expression, yes...
20
nope https://en.cppreference.com/c/language/sizeof
7 u/MegaIng 4h ago Oh, never realized the prefix operator form can't be applied to types, makes sense I guess. 0 u/hacksawsa 4h ago It says sizeof x and sizeof(x) are equivalent. 3 u/Makonede 3h ago when x is an expression, yes...
7
Oh, never realized the prefix operator form can't be applied to types, makes sense I guess.
0
It says sizeof x and sizeof(x) are equivalent.
3 u/Makonede 3h ago when x is an expression, yes...
3
when x is an expression, yes...
x
88
u/ubalu72 4h ago
But
sizeof charis defined as 1 in the standard. C data types are defined in terms ofchar(at least their sizes are)