#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define __SEC_POPEN_TOKEN " "
int main(void)
{
char *ptr;
char *strtokState;
char cmdcpy[30] = "Happy Birthday";
printf("%s \n",(ptr = strtok_r(cmdcpy, __SEC_POPEN_TOKEN, &strtokState)));
}
Execute code :
./a.out
Happy
Reference:
0 意見:
張貼留言