.h文件中声明了个全局变量数组 extern unsigned char a[];
.c文件中,定义这个数组的时候: a[30]; 这样的话提示‘a’重定义了
如果.c文件中不定义这个数组,直接在子函数里用,又提示很多警告。
求解,该怎么办,想声明个全局数组变量,然后各个.c文件中的子函数中用
加过了,还是不行
#ifndef __COM_H_
#define __COM_H_
#include
extern unsigned char str[30];
#endif
各个子函数文件头引用.h之前,加这个没有:
#define __COM_H_
加了,说的是这个吗
#ifndef __COM_H_
#define __COM_H_
#include
extern unsigned char a[30];
void dcomp(unsigned char recive[],unsigned char send[]);
#endif
把30去掉
extern unsigned char a[];
解决了 ,在.c文件中这样定义就行了 unsigned char a[30]={0};
谢谢了