gpt4 book ai didi

c++ - 为什么我的 std::string 被切断了?

转载 作者:太空宇宙 更新时间:2023-11-04 12:23:23 24 4
gpt4 key购买 nike

我初始化一个字符串如下:

std::string myString = "'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains all of the letters of the alphabet)";

myString 最终会像这样被切断:

'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains

我在哪里可以设置大小限制?我尝试了以下但没有成功:

std::string myString;
myString.resize(300);
myString = "'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains all of the letters of the alphabet)";

非常感谢!

最佳答案

当然,这只是调试器将其切断 (xcode)。我刚刚开始使用 xcode/c++,非常感谢您的快速回复。

关于c++ - 为什么我的 std::string 被切断了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3717538/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com