小编arg*_*oid的帖子

gcc错误:声明说明符中的两个或多个数据类型

gcc说我:

cc -O3 -Wall -pedantic -g -c init.c
init.c:6:1: error: two or more data types in declaration specifiers
init.c: In function 'objinit':
init.c:24:1: warning: control reaches end of non-void function
make: *** [init.o] Error 1
Run Code Online (Sandbox Code Playgroud)

代码是:

#include "beings.h"
#include "defs.h"
#include "funcs.h"
#include "obj.h"

void objinit(int type, struct object* lstrct){
     switch(type){
             case WALL:
                     lstrct->image = WALL_IMG;
                     lstrct->walk = false;
                     lstrct->price = 0;
             break;
             case WAND:
                     lstrct->image = WAND_IMG;
                     lstrct->walk = true;
                     lstrct->price = 70;
             break;
             case BOOK:
                     lstrct->image = BOOK_IMG; …
Run Code Online (Sandbox Code Playgroud)

c gcc struct

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

标签 统计

c ×1

gcc ×1

struct ×1