quote:
Originally posted by John Anderton
quote:
Originally posted by Madman
can you just typecast a char to an int to get the ascii value, or is that just in C++?
Erm .... im still a c newb if you didnt realise that from my coding style
Yeah i know typecasting and all ..... but i dont think you can do it like that .....
Well you can do it just using
code:
int nAscii = (int)cChar;//cChar beeing a char variable
in C++ but i dont know if you can in C, give it a shot and find out
(whats the worst that can happen
)
quote:
Originally posted by John Anderton
code:
print("%something here",some special method of calling the variable);
usually we say printf("%c",a); but here it should be something like printf("%c",'a'); but that doesnt work ..... and i cant find it in any book
To output a interger as the number value using printf you'd use.
code:
printf("%d", anInterger);
P.S Dont worry if im wrong i havnt been coding with c for very long either