??? 10/30/05 23:29 Read: times |
#103152 - The joy of C Responding to: ???'s previous message |
The usual way is to have a header file with the variables defined as [b]extern[/b] which is included in files where the variables are not declared, but you want to access them.
If variables are allocated manually, then the variables can be declared in all the files, but I'd consider that to be poor practice. Locations allocated manually are not flagged as used by the SDCC compiler, and you have to ensure that the compiler doesn't reuse them. |
Topic | Author | Date |
Using Multiple C files in SDCC | 01/01/70 00:00 | |
Not about the compiler | 01/01/70 00:00 | |
Nothing to do with SDCC | 01/01/70 00:00 | |
The joy of C | 01/01/70 00:00 | |
Sloppy terminology | 01/01/70 00:00 | |
Using Multiple C files in SDCC | 01/01/70 00:00 | |
Laziness | 01/01/70 00:00 | |
example | 01/01/70 00:00 | |
globals are generally bad ... | 01/01/70 00:00 | |
"Generally" being the important word! | 01/01/70 00:00 | |
re Globals![]() | 01/01/70 00:00 | |
static | 01/01/70 00:00 |