本文介绍了警告:建议用作真值赋值左右括号[-Wparentheses]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
节目片段是为素数提取写的。 The program snippet was written for prime number extraction.
该警告是由编译器作为之类的标题抛出。
The warning was thrown by the compiler as that like the title. while(count<=n) { for(c=2;c=(i-1);c++) //the warning is shown here { if(i%c==0) break; } if(c==i) { printf("%d ",i); count++; } i++; }
感谢你提前!
推荐答案的如果语句的中间前pression通常是有条件的,如 I&LT; ñ。你的情况,这是一个任务。
The middle expression of an if statement is usually a conditional such as i < n. In your case, it is an assignment.
编译器警告你,或许你犯了一个错误,你想用
The compiler is warning you that perhaps you made a mistake and you meant to use
c == (i-1)而不是
c = (i-1)更多推荐
警告:建议用作真值赋值左右括号[
发布评论