不同版本的Xcode上的strtok问题

时间:2014-03-06 12:51:32

标签: c++ xcode types char

当我更改用于在C中编程的Xcode时,以下代码的行为会随着相同的输入数据而改变:

    char * aux = strtok (message,Utilities::Constants::SERIALIZATION_SEPARATOR);
    int i=0;

    while (aux != NULL)
    {
        splitedData[i]=aux;
        i++;
        aux = strtok (NULL,Utilities::Constants::SERIALIZATION_SEPARATOR);
    }

所以在Xcode 5中,它实际上会返回分裂的字符串,但在Xcode 4.2中却没有。我相信它应该与charset有关,但我真的不知道。 message是char *,它是嵌入此代码的函数的参数。

提前致谢

0 个答案:

没有答案