C格式化输入
例句:
sscanf(xml, "%*[^0-9^-]%f", &speed);
解析:
-
: 表示忽略后面匹配的内容, 不要求后面加接收者的指针;%*
-
: 表示函数自行分配空间来存储, 用后释放;%m
-
: 匹配一串字符. For instance,%[]
means the set “everything except close bracket, zero throughnine, and hyphen”[^]0-9-]
C格式化输出
%u
和
%d
一样的规则:
-
当做int32输出%d
-
当做int16输出%hd
-
当做int8输出%hhd
-
当做long输出%ld
-
当做long long输出%lld