C程序的.h文件错误.以前的声明在这里 [英] error in .h file of a c program. previous declaration was here
本文介绍了C程序的.h文件错误.以前的声明在这里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
int ParseTable[50][50];
ParseTable[0][7]=1;
ParseTable[1][7]=3;
ParseTable[1][33]=3;
ParseTable[2][12]=4;
ParseTable[3][7]=5;
ParseTable[3][12]=6;
ParseTable[4][7]=7;
ParseTable[5][10]=8;
ParseTable[6][9]=9;
ParseTable[6][20]=10;
这是文件parser.h中的代码.
编译器显示错误:
This is a code in a file parser.h
the compiler shows error:
parser.h:54: warning: data definition has no type or storage class
parser.h:54: error: conflicting types for ‘ParseTable’
parser.h:52: note: previous declaration of ‘ParseTable’ was here
parser.h:54: error: invalid initializer
parser.h:55: warning: data definition has no type or storage class
parser.h:55: error: conflicting types for ‘ParseTable’
parser.h:52: note: previous declaration of ‘ParseTable’ was here
parser.h:55: error: invalid initializer
parser.h:56: warning: data definition has no type or storage class
parser.h:56: error: conflicting types for ‘ParseTable’
parser.h:52: note: previous declaration of ‘ParseTable’ was here
parser.h:56: error: invalid initializer
parser.h:57: warning: data definition has no type or storage class
parser.h:57: error: conflicting types for ‘ParseTable’
parser.h:52: note: previous declaration of ‘ParseTable’ was here
parser.h:57: error: invalid initializer
推荐答案
您需要将这些初始化操作移至实际的函数主体中.
You need to move those initializations into an actual function body.
这篇关于C程序的.h文件错误.以前的声明在这里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文