gpt4 book ai didi

c++ - 在返回值的函数中使用内部循环返回

转载 作者:行者123 更新时间:2023-11-30 05:27:30 24 4
gpt4 key购买 nike

<分区>

我怀疑在这种情况下,C++ 中的 return 是如何工作的。一旦条件匹配并且我们需要返回值,循环会发生什么。

some function(){
for( )//outer loop with i and other values
{
for( )// inner loop with i and other values {
some condition using if which on match return a value val (call it x here)
return x;
}
}
return -1
}

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