This is quite natural, given the fact, that char in C is not really a
type in its own right,
but instead a subtype of int, like short (only smaller).
If you keep that in mind, there is simply no difference between char
constants
and int constants.
HTH, kind regards
Bernd
Am 17.08.2022 um 22:07 schrieb Charles Mills:
Can of worms.
No more so that the well-established int foo = 'A';
Documentation?
I am sure I did not invent the syntax. I saw it somewhere in the docs.
Portability of e.g. "int foo = 'ABC';":
What about it? Just like the well-established int foo = 'A';
Blank/null fill?
Just like for the well-established int foo = 'A'; the characters are
low-order-justified and filled on the high side with zeros.
left/right justified?
Same as for int x = 1;
big/small-endian?
No more of an issue than for the well-established int foo = 'A';
Charles
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN