This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using arrays in both main.c file and other.c files for same project

Hi all. I'm having a problem with compiling my program because i want to use the same array inboth my main c file and my other c file.

Example: main.c

#include <absacc.h>
#include <stdio.h>
#include <SPI.h>
#include <DS1305.h>
#include <SDcard.h>

unsigned char rdat[12]; //To be used in main.c and SDcard.c

However if i declare it in both i get an error: Multiple public definitions
and if i declare it in only 1 of the two the compiler thinks that the array is undefined in one of them.

Please help me out. Can i solve this problem by defining the array in the SDcard.h file instead or any other solutions??/