Forum Discussion
Altera_Forum
Honored Contributor
16 years agoGet integer value from character array
I have character arrays of 3 ascii characters representing range values from a sonar. I need to do some calculation on these values now. How can I convert the ascii char array to a valid integer ...
Altera_Forum
Honored Contributor
16 years agochar* Sonar_HeightThe above code declares an array of character pointers. I think you probably want an array of characters instead:char Sonar_HeightAlso, the atio function expects a NULL terminated string. You could increase the character array to length 4 and set the last character to NULL.