gpt4 book ai didi

C++ 错误 : "Using obsolete binding"

转载 作者:太空狗 更新时间:2023-10-29 20:42:25 26 4
gpt4 key购买 nike

<分区>

我的编译器不喜欢以下代码的几个方面。非常感谢任何帮助。随意批评我,因为我是一个编程新手。我知道你们可能很苛刻。

// Method 2, the additive swap, explained inside. 
void strrev2(std::string& str) {
unsigned len = str.size();
for (unsigned i = 0, j = len - 1; i < j; i++, j--) {
short a = (int)str[i]; // a is the ASCII value of the i-th character of the string
short b = (int)str[j]; // b is the ASCII value of the j-th character of the string

// Current value of a Current value of b
a = a + b; // a + b b
b = a - b; // a + b a
a = a - b; // b a
}

str[i] = (char)a;
str[j] = (char)b;
}

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