Eric Minbiole
Joined: 10 Jun 2004 Posts: 16 Location: USA
|
|
Posted: Wed Nov 16, 2005 9:35 pm |
|
|
I see two problems:
1. The reason 300 "overflows" back to 44 is that "atoi()" only returns an 8 bit value. Even though you are assigning it to 16 bit Ti_Result, it has already overflowed. Use the "atol()" function instead.
2. Your string, Ti, is not long enough to hold your 3 character string + the terminating NUL character. It should be at least 4 characters if you are going to input a 3 digit number. This may not have been causing any immediate problems, but as your code grew, you would be overwriting whatever variable was after "Ti".
Hope this helps! (Bon de la chance? My French is rusty.) |
|