
Casting between int and pointer to char
Im working on a project that Im trying to keep as portable as possible. The
following code works but is giving me a "assingment makes pointer from int
without a cast" error.
<code snippet>
char *s;
int i;
i = (int) *s++;
</code snippet>
I dont understand why the cast I have used doesnt work. Shouldnt the value of
*s++ be evaluated then cast to int and then assinged to the variable i?
Thanks in advance.
Ryan
--
Who wants to remember that escape-x-alt-control-left shift-b puts you into
super-edit-debug-compile mode?
(Discussion in comp.os.linux.misc on the intuitiveness of commands, especially
Emacs.)
Ryan Mallon: Registered Linux user #282325