如何分割字符串转换成用C标记?
问题描述:
如何分割字符串成令牌由;用C
'和'?
How to split a string into tokens by '&'
in C?
答
char *token;
char *state;
for (token = strtok_r(input, "&", &state);
token != NULL;
token = strtok_r(NULL, "&", &state))
{
...
}