What�s the best way to declare and define global variables?

What�s the best way to declare and define global variables?

Best Way to represent a variable as global is -  Just define the variable at the initial or just below the headers files. though there can be many "declarations" of a single "global" variable or function, there must be exactly one "definition". If a program is in several source files,the best arrangement is to place each definition 
in some relevant source file, with an external declaration of function n variables in a seperate header file that is included by #include at the front of each source file.

By:Umang
Date:2002-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher