Variables...

General discussion on Visual GLCD Software.
Post Reply
Author
Message
StefanM
Posts: 1
Joined: 01 Aug 2012 11:47

Variables...

#1 Post by StefanM » 01 Aug 2012 11:59

Hello,

How can I use variables, created in "PROJECTNAME_events_code.c", in "PROJECTNAME_main.c" ?
Is there any solution for this "little problem"?

Thanks.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Variables...

#2 Post by filip » 02 Aug 2012 09:58

Hi,

You can do this using extern specifier. First, declare the variable in the PROJECTNAME_events_code.c file, like this :

Code: Select all

// PROJECTNAME_events_code file
char test;
...
Then, redeclare it in the PROJECTNAME_main.c using extern specifier :

Code: Select all

// PROJECTNAME_main file
extern char test;
...
Regards,
Filip.

Post Reply

Return to “Visual GLCD General”