string to int
可参考 stackoverflow 回答。
- atoi / atol
- strtol,可用于多种进制转换
- sscanf
int to string
- itoa
- sprintf / snprintf
MAC to string
本节来自 stackoverflow:
On a C99-conformant implementation, this should work
1 | unsigned char mac[6]; |
Otherwise, you’ll need:
1 | unsigned int iMac[6]; |