当前位置:网站首页>simple_strtoull字符转换相关函数
simple_strtoull字符转换相关函数
2022-06-22 09:04:00 【zuhan_20210314】
simple_strtoul
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base)
功能:将一个字符串转换成unsigend long long型数据。
返回:返回转换后数据。
参数:cp指向字符串的开始,endp指向分析的字符串末尾的位置,base为要用的基数(进制数),base为0表示通过cp来自动判断基数,函数自动可识别的基数:‘0x’表示16进制,‘0’表示8进制,其它都认定为10进制。函数可转换成数字的有效字符为:[0,f]。举例:cp = “0x12str”,base = 0,则返回unsigned long long为18,*endp = “str”。
来自 https://blog.csdn.net/caoyicheng1/article/details/22391319
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base)
功能:将一个字符串转换成unsigend long long型数据。
返回:返回转换后数据。
参数:
cp指向字符串的开始,
endp指向分析的有效字符串末尾的位置,
base为要用的基数(进制数),
base为0表示通过cp来自动判断基数,函数自动可识别的基数:
‘0x’表示16进制,
‘0’表示8进制,
其它都认定为10进制。函数可转换成数字的有效字符为:[0,f]。举例:cp = “0x12str”,base = 0,则返回unsigned long long为18,*endp = “str”。
相关的其他一些函数:
unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base)
功能:将一个字符串转换成unsigend long型数据。
返回:返回转换后数据。
int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
功能:将一个字符串转换成unsigend long型。
返回:转换成功返回0,否则返回负。res指向转换后的unsigned long数据。
说明:该函数对cp指向的字符串严格要求,cp指向的字符串必须为真正的unsigned long形式的字符串。字符串必须以“0x”、“0”、[0,f]开始,中间全部为有效的字符[0,f],否则返回为负。它会处理字符串最后的“\n”字符。下同
long long simple_strtoll(const char *cp, char **endp, unsigned int base)
功能:将一个字符串转换成sigend long long型。
返回:返回转换后数据。
int strict_strtol(const char *cp, unsigned int base, long *res)
功能:将一个字符串转换sigend long型。
返回:转换成功返回0,否则返回负。res指向转换后的signed long数据。
int strict_strtoull(const char *cp, unsigned int base, unsigned long long *res)
功能:将一个字符串转换unsigend long long型。
返回:转换成功返回0,否则返回负。res指向转换后的unsigned long long数据。
int strict_strtoll(const char *cp, unsigned int base, long long *res)
功能:将一个字符串转换sigend long long型。
返回:转换成功返回0,否则返回负。res指向转换后的signed long long数据。
int sprintf(char *buf, const char *fmt, ...)
功能:格式化输出字符串,类似于printf,只是用字符串buf作为输出对象。
返回:返回写入buf字符串的字符个数。
int snprintf(char *buf, size_t size, const char *fmt, ...)
功能:格式化输出字符串,类似于printf,只是用字符串buf作为输出对象。其中size为buf的大小(包括‘\0’字符)。
返回:返回写入buf字符串的字符个数。
int sscanf(const char *buf, const char *fmt, ...)
功能:格式化输入字符串,类似于scanf,只是用字符串buf作为输入对象。
返回:返回读取buf字符串的字符个数。
边栏推荐
- Development error reporting record
- np. Arange and np Linspace nuances (data overflow problem)
- Flask blog practice - realize the article list page and details page
- Flask blog practice - display the navigation menu and home page data of the whole site
- Shell中的单中括号和双中括号的区别
- WebRTC系列-网络传输之IceConfig及stunPing失败处理
- Chapter II exercise | MNIST dataset | Titanic dataset | image enhancement
- The U.S. Department of justice established a national crypto enforcement team to combat illegal acts in related fields
- CF1267G Game Relics
- Report: in the technical field, men are more likely to get job interviews
猜你喜欢

Solidity from introduction to practice (IV)

Remove the restriction of video memory occupied by tensorflow GPU

14 responsibility chain mode

OpenCV每日函数 直方图相关(3)

电机学感应电动机重点知识总结(现有题目中反映的)

Solid from entry to practice (end)

一学就会的tensorflow断点续训(原理+代码详解)

模板引擎,让交互变得优雅
![Wireless routing attack and WiFi password cracking practice [penetration technology]](/img/b9/3551630c128e03731a956c6a6502e2.jpg)
Wireless routing attack and WiFi password cracking practice [penetration technology]

Off line identification of least square method
随机推荐
新型冠狀病毒疫情
Hashtable source code analysis, collections Synchronizedmap parsing
版本问题导致“无法定位程序输入点OPENSSL_sk_new_reserve于动态链接库C:\Users...\libssl-1_1-x64.dll”
kali木马入侵win7系统
STM32 crashes when upgrading bootloader to jump app Online
Flask blog practice - realize the article list page and details page
Flask blog practice - user management
Quick search system (aso+xls) v1.0
深入解析final关键字的用法
ffmpeg之volumedetect
【node】理论+实践让你拿下session、cookie
Flask blog practice - integrated rich text editor quill
Xshell远程服务器tensorboard/visdom的本地可视化方法【亲测一步有效】
让你轻松上手【uni-app】
无线路由攻击和WiFi密码破解实战[渗透技术]
PHP de duplication and arrange complete small functions in descending order of length
CF1267G Game Relics
微表情数据集汇总(全)
Thread. Source code analysis of start() method
Deep learning - (1) RESNET implementation