小编Raj*_*jan的帖子

错误:'for'循环初始声明仅允许在C99模式下使用

我收到以下错误,什么是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)

c loops

19
推荐指数
2
解决办法
6万
查看次数

如何在 maven 的 POM 中使用 jsonschema2pojo

我有一个 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 文件。但是我越来越了。请帮帮我。谢谢,拉吉特

java pojo maven-plugin

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

c ×1

java ×1

loops ×1

maven-plugin ×1

pojo ×1