gpt4 book ai didi

c - 如何使用 C 语言执行以下操作?

转载 作者:行者123 更新时间:2023-11-30 21:16:45 26 4
gpt4 key购买 nike

基本上,我想在每次满足条件时创建一个 int x,所以像...

while(CONDITION){
if(int x = 100){
//create a new int
//refrence newly created variable
}
}

然后我想再次运行循环,但测试新创建的变量而不是 x。希望这足够清楚!

最佳答案

C 语言中没有“创建 int”的概念。如果需要,您可以为现有 int 分配新值:

int x, newx;
while(CONDITION){
if(x == 100){
newx = x;
}
}

关于c - 如何使用 C 语言执行以下操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3755964/

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