c語(yǔ)言strtol函數(shù)用法 strtoul( )函數(shù)的具體用法是什么?
strtoul( )函數(shù)的具體用法是什么?Strtoul(將字符串轉(zhuǎn)換為無(wú)符號(hào)長(zhǎng)整數(shù))頭文件#include<stdlib。H>定義無(wú)符號(hào)長(zhǎng)字符串的函數(shù)(const char*NPTR,cha
strtoul( )函數(shù)的具體用法是什么?
Strtoul(將字符串轉(zhuǎn)換為無(wú)符號(hào)長(zhǎng)整數(shù))頭文件#include<stdlib。H>定義無(wú)符號(hào)長(zhǎng)字符串的函數(shù)(const char*NPTR,char**endptr,int base)。示例:將十六進(jìn)制0xff轉(zhuǎn)換為十六進(jìn)制10以獲得255#include<stdlib。H>#包括<stdlib。H> int main(){int a char pnum[]=0xff a=strtoul(pnum,0,0)//最后一個(gè)0表示pnum是十進(jìn)制printf(%dn,a)return 0}