Jun 18, 2008 #1 T te04-0202 Junior Member level 1 Joined Jun 17, 2008 Messages 16 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,281 Activity points 1,373 keil itoa How to convert ASCII characters into numeric values in KEIL COMPILER.
Jun 18, 2008 #2 M mostafahk Junior Member level 2 Joined May 28, 2008 Messages 20 Helped 4 Reputation 8 Reaction score 2 Trophy points 1,283 Location tehran Activity points 1,422 keil ascii to character if you want to convert a single character : Code: char c = '5'; int a = c - '0'; // now a = 5 if you want to convert an ascii array: Code: int a = 0; char num[] = {'1' , '9' , '3' }; a = conv( num , 3 ); // now ans=193 . . . int conv( char arr[] , char len ) { int ans = 0; char i; for( i = 0 ; i < len; i++ ) { ans *= 10; ans += arr[i]-'0'; } return ans; }
keil ascii to character if you want to convert a single character : Code: char c = '5'; int a = c - '0'; // now a = 5 if you want to convert an ascii array: Code: int a = 0; char num[] = {'1' , '9' , '3' }; a = conv( num , 3 ); // now ans=193 . . . int conv( char arr[] , char len ) { int ans = 0; char i; for( i = 0 ; i < len; i++ ) { ans *= 10; ans += arr[i]-'0'; } return ans; }
Jun 19, 2008 #3 S sureshreddy Member level 3 Joined May 12, 2008 Messages 66 Helped 5 Reputation 10 Reaction score 1 Trophy points 1,288 Location BANGLORE Activity points 1,605 character ascii keil c te04-0202 said: How to convert ASCII characters into numeric values in KEIL COMPILER. Click to expand... HAI, you can use below a to i function in keil also.nothing wrong. int i; char s [] = "12345"; i = atoi (s);
character ascii keil c te04-0202 said: How to convert ASCII characters into numeric values in KEIL COMPILER. Click to expand... HAI, you can use below a to i function in keil also.nothing wrong. int i; char s [] = "12345"; i = atoi (s);
Jun 22, 2008 #4 T te04-0202 Junior Member level 1 Joined Jun 17, 2008 Messages 16 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,281 Activity points 1,373 keil char to ascii How to convert an integer into character.
Jun 22, 2008 #5 H Help Advanced Member level 2 Joined Feb 15, 2005 Messages 617 Helped 7 Reputation 14 Reaction score 3 Trophy points 1,298 Activity points 7,065 keil get ascii code Hi, I think you can try to use the fomula. Code: No = No * 10 + ch - '0'; Good Luck.
keil get ascii code Hi, I think you can try to use the fomula. Code: No = No * 10 + ch - '0'; Good Luck.
Jun 24, 2008 #6 S sureshreddy Member level 3 Joined May 12, 2008 Messages 66 Helped 5 Reputation 10 Reaction score 1 Trophy points 1,288 Location BANGLORE Activity points 1,605 Re: How to convert ASCII characters into numeric values in K te04-0202 said: How to convert an integer into character. Click to expand... HAI, for this you have to use itoa.
Re: How to convert ASCII characters into numeric values in K te04-0202 said: How to convert an integer into character. Click to expand... HAI, for this you have to use itoa.