系统接口函数详解
1. getline 函数
1.1 函数概述
getline
函数用于从流中读取一个以特定分隔符分隔的记录。
1.2 函数原型
#include <stdio.h>
ssize_t getline(char **restrict lineptr, size_t *restrict n, FILE *restrict stream);
1.3 详细描述
关于该函数的详细描述可参考 getdelim
函数。
2. getlocalename_l 函数
2.1 函数概述
getlocalename_l
函数用于从一个本地化对象中获取本地化名称。
2.2 函数原型
#include <locale.h>
const char *getlocalename_l(int category, locale_t locobj);
2.3 详细描述
- 若
category
不是LC_ALL
,此函数会返回指定本地化对象locobj
对应本地化类别的名称;若locobj
是