拆分字符串

来源:互联网 发布:软件测试公司排行 编辑:程序博客网 时间:2024/03/29 22:51
#include<iostream>#include<string>using namespace std;void liststring(char sstring[]){    char* p = sstring;    while (*p != '\0')    {        if (*p == ' ')        {            p++;            cout << endl;        }        cout << *p;        p++;    }    cout << endl;}int main(){    char str[100] = "jdbk sgd l;n\n";    cout << str << endl;    liststring(str);    system("pause");    return 0;}
0 0