Writing a logging system and I just want an array to be stored and modified in a module (let's call it foo.c, with an appropriately-named header file foo.h) while being able to access it's contents in main.c. In foo.c I have:
unsigned char log[4096] = {0};
while main.c is as follows:
#include "foo.h"
int main(){
extern unsigned char log[4096];
// code
return 0
}
Which yields the error:
error: 'log' redeclared as different kind of symbol
Am I doing this right? I tried declaring the extern log as "log[]" and "log" but those were of no avail either. A little enlightenment on the issue would be helpful. Thank you!