[Courses] [C] Beginner's Lesson 4B: Arrays, Qualifiers, and
Reading Numbers
Daniel.
cristofd at hevanet.com
Tue Oct 15 12:01:10 EST 2002
>Second, the signed-type-specifier never existed until the advent
>of ANSI C. So all the old traditional C compilers will default to
>unsigned!!! So B carefull.
Not quite. The type-specifier didn't exist, but the type did; the
specifier was not needed because signed was the default type, as it
still is under ANSI except in the case of "char", which varies. That
is, before ANSI, you could say
int a; /*signed*/
unsigned int b; /*unsigned*/
and now you still can, but if you like to spell things out you can also say
signed int c; /*signed*/
if you don't like to spell things out you can shorten the unsigned to
unsigned d; /*unsigned*/
and gcc will even let you get away with
e; /*signed*/
(only if in global scope, and with a warning even then).
-Daniel.
--
More information about the Courses
mailing list