what is the difference between these statement

T

Tim Rentsch

I'm a bit confused about why 'EOF' can't be 0x100.

Do you have a copy of N1256 or N1570? If not grab one or
both:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
I know it can't be any value of 'unsigned char' converted
to 'int', that is a valid character at least.

The bold entries in the Index are primary or definitional.
For 'EOF' that will lead right to 7.19.1 (in n1256), which
says EOF is an integer constant expression, with type int
and a negative value. (And 'int' will always hold 0x100
as a positive value, in every implementation.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,207
Latest member
HelenaCani

Latest Threads

Top