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)