sscanf 分割字符串
#include <iostream>using namespace std;int main(){cout<<"sscanf"<<endl;char * str = "45:56";int a=0;int b=0;sscanf(str, "%d:%d", &a, &b);cout<<a<<endl<<b<<endl;return 0;}
输出:
sscanf
45
56