📜  在空格处分割字符串 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:37.584000             🧑  作者: Mango

代码示例1
char* string;
char* first;
char* second;

for (int i=0;i<=strlen(string);i++) {
    if (string[i] == ' ') {
        string[i] = '\0';
        first = string;
        second = string+i+1;
        break;
    }
}