   Forcing a variable into global scope from inside function?
  Is it possible in C to do this?I want a var declared inside of a function to be visible to all functions...Any tricks? 
  not the best one: global variable.or, pass it as a parameter. ;quote:Original post by smitty1276  Any tricks?Nope.Well... Redesign your code! ;  Im thinking maybe a bit better way of doing it would be to place the variable in its own namespace, rather than in the global namespace. ;  Yeah, make it static, and create a global pointer that points to it =P ;  I''m trying to emulate templates in C (I posted about this a couple of days ago...)For a linked list, for example... I can have a static variable counting "instances" of these lists(incremented via an initialization function... LLInitialize(LinkedList*) ).Then,each "instance" of its list, from within the init function can create a node structure on the fly with macros... #define MakeType(instanceNumber, type) \typedef struct \{ \   type data; \   //yada yada \} Type##instanceNumberHowever, that macro must be called from within the initialization function for the "instance".... so none of the lists other functions can have access to the variable or data type created.I''m just trying to find a work around.