haxan
New Member
Hi. I am having an issue with variables and their scope. How can i access variables directly which are in one C file to another C file in the same project?
For example i have two C files, code1.c and code2.c
Some variables that i declared in code1.c i want to use directly into code2.c
Is there anyway to do it?
Example:
code1.c:
unsigned char myVariable = 24;
code2.c:
#include "code1.c"
myVariable = myVariable + 2;
For example i have two C files, code1.c and code2.c
Some variables that i declared in code1.c i want to use directly into code2.c
Is there anyway to do it?
Example:
code1.c:
unsigned char myVariable = 24;
code2.c:
#include "code1.c"
myVariable = myVariable + 2;
Last edited: