为什么撇号停止串流/打印?

时间:2015-05-24 14:33:29

标签: c++ stringstream

funciton split将wstring和wstring数组作为参数,并且应该保存数组中wstring的单词。

int split(std::wstring line, std::wstring a[]) {
    std::wstringstream wordStream;
    wordStream << line;
    std::wstring word;

    int wordCount = 0;
    for (int i = 0; wordStream >> word; i++) {
        a[i] = word;
        wordCount++;
    }

    return wordCount;

}

它工作正常,但后来我尝试了这句话:

int main() {
    std::wstring a[100];
    std::wcout << split(L"Confounding declarations of ISIS’ decline, twin offensives in Ramadi and Palmyra have become a sudden showcase for the terrorist group’s disciplined adherence to its core philosophies.", a) << std::endl;
    for(int i = 0; i < 100; i++) {
        std::wcout << a[i] << "|";
    }
}

我得到了这个:

26
Confounding|declarations|of|ISIS

它停在撇号:'

我尝试用'替换它',它再次起作用。这里发生了什么?

0 个答案:

没有答案