我刚才拉了一段代码,我写了一会儿,我得到以下错误:错误:“为”循环初始声明只允许在C99模式我如何允许“C99模式”?谢谢。
以上来自于百度翻译
以下为原文
I've just pulled in sum code i wrote a while back and i'm get
ting the following error:
error: 'for' loop initial declarations are only allowed in C99 mode
How do I allow "C99 mode"?
long power (long number, long order)
{
long result = number;
for (unsigned int n = 0; n < (order - 1); n++)
{
result = result * number;
}
if (order == 0)
{
result = 1;
}
return (result);
}
Thanks.