// sscanf() 高级用法: 跳过内容 #include #include int main() { char *content = "disen,17791692095,610039018"; char first = 0; char phone[12] = ""; char qq[12] = ""; sscanf(content, "%c", &first); printf("%c\n", first); // 跳过前6个字符,然后读取11个字符,放入 phone 中 sscanf(content, "%*6s%11s", phone); printf("%s\n", phone); sscanf(content, "%*18s%11s", qq); printf("%s\n", qq); }