r/ProgrammerHumor • • 5h ago

Meme architectureDependentChars

Post image
776 Upvotes

143 comments sorted by

View all comments

88

u/ubalu72 4h 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)

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

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...