我收到以下错误,什么是std = c99/std = gnu99模式?
源代码:
#include <stdio.h>
void funct(int[5]);
int main()
{
int Arr[5]={1,2,3,4,5};
funct(Arr);
for(int j=0;j<5;j++)
printf("%d",Arr[j]);
}
void funct(int p[5]) {
int i,j;
for(i=6,j=0;i<11;i++,j++)
p[j]=i;
}
Error Message:
hello.c: In function ‘main’:
hello.c:11:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int j=0;j<5;j++)
^
hello.c:11:2: note: use option -std=c99 or -std=gnu99 to compile your code`
Run Code Online (Sandbox Code Playgroud) 我有一个 JSON 文件,我想将它转换为 POJO,为此我在 maven 中使用 org.jsonschema2pojo 插件。我无法生成结果 pojo。这是 pom.xml 中的片段
<build>
<plugins>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>0.4.23</version>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
<targetPackage>${basedir}/src/main/resources/result</targetPackage>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
我在 maven 中使用 generate source 目标。我的期望是它应该在 ${basedir}/src/main/resources/result 位置给我 pojo 文件。但是我越来越了。请帮帮我。谢谢,拉吉特