Problem using function strtol/strtoul
I am using the function strtol to convert a string to long no. and I am using this long no. to address a port.
I am fetching this string from the edit box of a window.
I am facing a very peculiar type of problem.
My port address is hex 200.
When in the edit box I place 200 the system verifies that the port is addressed successfully(which should be the case).
When I place 20G in the edit box again the port verifies successfully. (I feel that strtol converts it to 20)
But if I change the port address in the program code from 200 to 20 I receive a verification failed message.(which is right as the port address is not 20 but 200)
What is the problem in fetching the string (I am geting it as Cstring type) or converting it to long using strtol.