Jun 23, 2006 #1 tvrtko Programmer Joined Nov 26, 2003 Messages 53 Location HR How to get ASCII code of character? Thanks in advance.
Jun 23, 2006 #2 dEVooXiAm Programmer Joined Jun 8, 2005 Messages 103 Location LT Where do you want to get it? in C language, data type 'char' is a numeric type, so either using debugger, or printing the value Code: printf("%d", cChar); will provide you with the exact code of your character. ------------------ When you do it, do it right. Upvote 0 Downvote
Where do you want to get it? in C language, data type 'char' is a numeric type, so either using debugger, or printing the value Code: printf("%d", cChar); will provide you with the exact code of your character. ------------------ When you do it, do it right.
Jun 23, 2006 Thread starter #3 tvrtko Programmer Joined Nov 26, 2003 Messages 53 Location HR I need to save ASCII code of character in int variable. Is there some function in c++ to do this? Upvote 0 Downvote
Jun 23, 2006 1 #4 cpjust Programmer Joined Sep 23, 2003 Messages 2,132 Location US Code: char c = 'F'; int ascNum = c; A char is just a 1 byte int. Upvote 0 Downvote
Jun 23, 2006 Thread starter #5 tvrtko Programmer Joined Nov 26, 2003 Messages 53 Location HR Thanks. Upvote 0 Downvote