gpt4 book ai didi

c - while 循环检查以逗号分隔的两个值

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

我遇到过一些看起来像这样的代码。

while(1, N) 

其中 N 可以是 0 - 100 之间的整数。

有人能告诉我们如何使用 while 循环吗?

最佳答案

根据 C11 标准文档,第 6.5.17 章,逗号运算符,

The left operand of a comma operator is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value.

所以,本质上,

while(1, N)

相同
 while(N)

关于c - while 循环检查以逗号分隔的两个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29823167/

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