>My only disagreement would be to use char as signed. It should be
>reserved for character data, e.g. "char foo[10]" would be a string of
>length 10. But then, I have always been a proponent of strongly-typed
>languages. It catches a lot of silly errors.
Most C compilers have command line switches to force char to
unsigned, but that can lead to portability issues if you're forced to
use a compiler that doesn't support it, or if someone forgets to use
the switch.
There may be #pragma's that will do it; that at least moves the
information in to the actual code where it belongs, but I doubt that
they're standardized.
Myself, I use BYTE foo[10]; to declare character data arrays and
typedef BYTE * STRING; // used with null-terminated strings
to define string pointers:
STRING sp; // pointer to colon in string
sp = strindex(foo, ':'); // sp points to (first) colon (or NULL if not found)
etc...
>So clearly, I am right and everyone else is wrong. ;-)
Clearly. Same goes for me. :)
...Andy
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment