gpt4 book ai didi

c++ - 晦涩的 C++ 语法

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

<分区>

Possible Duplicate:
C++ Comma Operator

大约一年前,我在我从事的编码项目中注意到一些晦涩的语法:

table_value = table_index += 2, valueFromTable(table_index);

有人认识这个吗?这就像一个带有附加语句的作业。这是在我们的整个跨平台编译器套件中编译的,所以我很确定它是有效的 C++,但我从未见过类似的东西。

如有任何见解,我们将不胜感激。

大齿轮

编辑:继承人一些工作代码:

#include <iostream>
using namespace std ;

int valueFromTable(int a) { return a ; }

int main()
{
int table_index = 0 ;
int table_value = table_index += 2, valueFromTable(12);
cout<<table_value<<endl;
return 0 ;
}

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