如何解决"对于使用C99模式&QUOT外循环初始声明; GCC错误? [英] How do I fix "for loop initial declaration used outside C99 mode" GCC error?
本文介绍了如何解决"对于使用C99模式&QUOT外循环初始声明; GCC错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图解决的3N + 1问题,我有一个为
循环,看起来像这样:
I'm trying to solve the 3n+1 problem and I have a for
loop that looks like this:
for(int i = low; i <= high; ++i)
{
res = runalg(i);
if (res > highestres)
{
highestres = res;
}
}
不幸的是,当我尝试用GCC编译我得到这个错误:
Unfortunately I'm getting this error when I try to compile with GCC:
3np1.c:15:错误:'for'循环初始
境外使用C99模式声明
3np1.c:15: error: 'for' loop initial declaration used outside C99 mode
我不知道C99模式是什么。任何想法?
I don't know what C99 mode is. Any ideas?
推荐答案
我想尝试申报 I
循环外!
祝你好运3N + 1: - )
Good luck on solving 3n+1 :-)
这篇关于如何解决&QUOT;对于使用C99模式&QUOT外循环初始声明; GCC错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文