variable scope

new topic     » topic index » view thread      » older message » newer message

I have a question regarding variable scopes.

Is it possible to declare a variable or constant that is truly global, 
across all includes?

In reading the manuals, I understand the desire to keep scope limited to 
a routine, but I don't understand the why of limiting to a given 
include, or an include and the main program, but not a truly global 
variable or constant across all files.

Am I misunderstanding the use of the include files?  I want to be able 
to break my libraries into neat groups, but several of these libraries, 
distinctly different in my mind, require the same variable.  I would 
rather not have to pass that variable constantly to functions in 
different files; it's set once and never changes.  (A pointer to a 
bitmap used as a back buffer.)

Any clarifications about the scope of variables or how I can get around 
this?  Am I thinking wrongly about the use of include files?

Thanks,
Nate

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu