What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » C Programming Question

C Programming Question
Author: Message:
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
34 / Male / –
Joined: Jun 2004
RE: C Programming Question
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 :P
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 :P (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 :sad:
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 :P

This post was edited on 10-03-2005 at 07:32 PM by Plik.
10-03-2005 07:25 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
C Programming Question - by John Anderton on 10-03-2005 at 06:48 PM
RE: C Programming Question - by Yousef on 10-03-2005 at 07:03 PM
RE: RE: C Programming Question - by Plik on 10-03-2005 at 07:06 PM
RE: C Programming Question - by John Anderton on 10-03-2005 at 07:18 PM
RE: C Programming Question - by Plik on 10-03-2005 at 07:25 PM
RE: C Programming Question - by John Anderton on 10-03-2005 at 07:33 PM
RE: RE: C Programming Question - by segosa on 10-04-2005 at 06:09 AM
RE: C Programming Question - by J-Thread on 10-03-2005 at 08:27 PM
RE: C Programming Question - by John Anderton on 10-04-2005 at 07:45 AM
RE: C Programming Question - by RaceProUK on 10-04-2005 at 10:46 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On