do{
float diameter;
scanf("%f",&diameter);
Printf("Please input diameter");
if(cheack1(diameter) == 0){
Printf("Please input a valid number greater than 0");
}else{
circle(&area, &perimeter, diameter);
}
int cheack = cheack1(diameter);
}while(cheack == 1);
我的 do-while 循环有问题。如您所见,我已经声明了
int cheack = cheack1(diameter);
检查我的cheack1(diameter);
输入是否正确,如果正确则返回 1。
但我的错误是:
p7t5.c: In function ‘main’:
p7t5.c:87:11: error: ‘cheack’ undeclared (first use in this function)
似乎while(cheack == 1);
是不记得cheack
do-while 循环的内部。