Make this conversion please.

Can anyone tell me if there is a function of simply converting character array to a short int?
For example.
char array[4]={'0','2','f','f'};

to short int 767?
I think that it is your assignment. There is no such standard function in C/C++.
Last edited on
Refer this link if you are looking for this,

http://www.cplusplus.com/reference/cstdlib/strtol/
@Ferni


His character array is not zero-treminated. So it can not apply strtol function..
Last edited on
Topic archived. No new replies allowed.