hi
how do i convert a string to decimal value?
i read in a string "20" , how do i convert it from string to decimal.. does reading it as a string assume its hex?
what if i want the hex value? and then convert to decimal
thanks
atoi converts a string to an int. It assumes the number is decimal and starts with +/- or a number. Any other initial characters causes it to return zero.
If you want to convert using another base, such as 16, you may have to do it yourself, but it's not hard.