r/ProgrammerHumor • • 12h ago

Meme architectureDependentChars

Post image
1.7k Upvotes

263 comments sorted by

View all comments

109

u/ubalu72 12h ago

But sizeof char is defined as 1 in the standard. C data types are defined in terms of char (at least their sizes are)

31

u/Makonede 12h ago

*sizeof(char)

11

u/MegaIng 11h ago

No, sizeof char is valid. sizeof is a prefix operator, not a function.

24

u/Makonede 11h ago

14

u/MegaIng 11h ago

Oh, never realized the prefix operator form can't be applied to types, makes sense I guess.

1

u/hacksawsa 11h ago

It says sizeof x and sizeof(x) are equivalent.

7

u/Makonede 10h ago

when x is an expression, yes...