ISO C90 禁止在 C 中混合声明和代码 [英] ISO C90 forbids mixed declarations and code in C
本文介绍了ISO C90 禁止在 C 中混合声明和代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我以这种方式声明了一个变量:
I declared a variable in this way:
int i = 0;
我收到警告:
ISO C90 禁止混合声明和代码
ISO C90 forbids mixed declarations and code
我该如何解决?
推荐答案
我认为您应该将变量声明移到块的顶部.即
I think you should move the variable declaration to top of block. I.e.
{
foo();
int i = 0;
bar();
}
到
{
int i = 0;
foo();
bar();
}
这篇关于ISO C90 禁止在 C 中混合声明和代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文