What's the best way to declare and define global variables?
Answers were Sorted based on User's Feedback
Answer / guest
The best arrangement is to place each definition in some
relevant .c file, with an external declaration in a header file.
| Is This Answer Correct ? | 17 Yes | 3 No |
Answer / karnik ankit
the best way to declare and define global variables after
the header files or before the main function.
| Is This Answer Correct ? | 11 Yes | 1 No |
Answer / anurag aggarwal
after declaring the header files declare the global
variables to be used that is the best way.
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / vignesh1988i
as for C is concerned the best way to declare and define the
global variable is brefore the main() function
| Is This Answer Correct ? | 10 Yes | 5 No |
Answer / ajeet singh
through the "public" key world, we define the globle variable.
| Is This Answer Correct ? | 1 Yes | 5 No |
What is a shell structure examples?
What is the role of this pointer?
Why does everyone say not to use gets?
consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none
What are dangling pointers? How are dangling pointers different from memory leaks?
Is array a primitive data type in c?
What is Dynamic Initialization.
What is difference between Structure and Unions?
Explain the bubble sort algorithm.
What are qualifiers?
I have a varargs function which accepts a float parameter?
What are the general description for loop statement and available loop types in c?