I'm trying to move a void to another file (for organization) but then i need to include all of its variables and stuff it needs. When i include .h file then i get it saying everything has been defined twice. Since that didn't work i reverted back to one file. I do have it declared however that is in another .h file. Right now in one file it works but i need it another file.
How can i split this up so the void is in a separate file?
The Code:
Link removed - solved see the third reply
Lines 34-70 are needed by the void
Lines 176-332 are the void
When you declare an array the size must be known. here BRICKS is not known yet so that is why you get an error. Constants is a bit special so you can define it in the header without using extern. Doing this will fix the problem.
global constants are implicitly static so you don't have to use static here. This is actually the reason why it's fine to define the constants in the header.