santinu
Newbie level 3

Hi
I am using uVision V3.30 to program the ATMEL 89C51AC2.
I am having a problem to convert char to integer numbers.
My problem is that i accept an input from a specific keypad as a character lets say '5' and i want to make certain calculations with this number.
I cannot calculate using a char variable therefore i have to convert it to an integer.
Using this command (int)(5) i get the ascii value of '5' not the actual number.
Can anyone help me out figuring what i should do so that the number taken as an input can be even used in calculations?
Thanks & Regards
Santinu
I am using uVision V3.30 to program the ATMEL 89C51AC2.
I am having a problem to convert char to integer numbers.
My problem is that i accept an input from a specific keypad as a character lets say '5' and i want to make certain calculations with this number.
I cannot calculate using a char variable therefore i have to convert it to an integer.
Using this command (int)(5) i get the ascii value of '5' not the actual number.
Can anyone help me out figuring what i should do so that the number taken as an input can be even used in calculations?
Thanks & Regards
Santinu