How would I go about converting a two-digit number (type char*
) to an int
?
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
Use atoi() from
<stdlib.h>
http://linux.die.net/man/3/atoi
Or, write your
atoi()
function which will convertchar*
toint
atoi can do that for you
Example: