We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am having problems getting atoi to work.
here is how I populate the comin[] array
do { comin[index] = (getchar()); ++index; } while (index<=4);
later in the program I do the following:-
command = atoi(comin);
expecting to get a 4 digit number in command. comin is working fine - no problems. But command is always 0 (zero). I have tried quite a few things, but no luck. I did a search on the forum andd came up with this
http://www.keil.com/forum/docs/thread10470.asp
Anybody else had this problem or know a work around?
My program is now working 100%. The serial input routine is working and the atoi is also working correctly. I spent the better part of the last few days testing the system and inputing both good and bad data and it works correctly.
My thanks for the feedback and guidance.
Jason