Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/18/01 10:29
Read: times


 
#11685 - RE: integer to character!!
printf("%c", Character);

Means, "print the character having the ASCII code value given by Character"
ASCII code 9 is HT (Horizontal TAB).

Character = '9'; 

Means, "Assign the ASCII code value for the character '9' to Character"
The ASCII code for '9' is 0x39,
The ASCII code for '8' is 0x38,
The ASCII code for '7' is 0x37...
get the idea?

So, to convert an integer value 0..9 to its ASCII character code, just add 0x30

With the aid of an ASCII table, you should be able to work out how extend this to convert an integer value 0..F to its ASCII character code.

List of 4 messages in thread
TopicAuthorDate
integer to character!!            01/01/70 00:00      
RE: integer to character!!            01/01/70 00:00      
RE: integer to character!!            01/01/70 00:00      
use ASCII            01/01/70 00:00      

Back to Subject List