如果我有一个我知道长度不变的字符串,我应该使用什么?
char test[100]
std::array<char, 100> test
std::string test
谢谢!
最佳答案
答案在问题中:
If I have a string ...
如果你有一个字符串,使用std::string
。除非您有未提及的非常具体的要求。
关于C++:char test[100] vs array<char, 100> vs string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33103650/