Hacker News new | ask | show | jobs
by kzrdude 1143 days ago
Maybe do not overthink it. 'x' is called a character literal, but it has the type int.

`{'x', 'y', 'z', '\0'}` does not have a type by itself, but it's valid syntax to use it to initialize various structs and arrays - some of those will have the size you are looking for, depending on which type of array or struct you choose to initialize with that: https://gcc.godbolt.org/z/Tqjq3xzKo

1 comments

Thank you for the explanation and the Godbolt example! I appreciate it. Apologies for fumbling around in confusion.