// strtok_test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <process.h>
#include <iostream>
#include <cstring>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char str[]="天策,男,19900912,安徽";
char *next=NULL;
const char *strSplit=",";
char *p;
p=strtok_s(str,strSplit,&next);
while (p)
{
cout<<p<<" -----";
p=strtok_s(NULL,strSplit,&next);
}
system("pause");
return 0;
}
strtok
最新推荐文章于 2024-04-28 20:18:46 发布