sscanf
作者:互联网
#include <stdio.h>
int main()
{
char v1 = 127;
printf("%c\n",v1);
printf("\123\n\n"); // 转义8进制 S
printf("\x40\n"); // 转义16进制
printf("12345zhao\rbxiaoyu\n"); // 回到行首,并覆盖
printf("%c",'A'+32); //大写转换小写加32
int a,b;
scanf("%dabc%d",&a,&b);
printf("%d---%d\n",a,b);
char buf[]="xiaomi123xiaohong";
char buf1[7],buf2[9];
int d;
sscanf(buf,"%6s%d%8s",buf1,&d,buf2);
printf("%s\n",buf1);
printf("%d\n",d);
printf("%s\n",buf2);
return 0;
}
标签:sscanf,int,buf2,char,buf1,printf 来源: https://www.cnblogs.com/lodger47/p/15088396.html