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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

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

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

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

Answer / sathish

before the main

Is This Answer Correct ?    1 Yes 2 No

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

Answer / ajeet singh

through the "public" key world, we define the globle variable.

Is This Answer Correct ?    1 Yes 5 No

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

Answer / s.madhavi

By using #define directive............

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More C Interview Questions

WHAT IS RTGS N MINIMUM AMT TO B TRANSFERD N WHAT R THE CHARGES ON MINIMUM AMT N IN WHICH BANK WE CAN DO IT?

1 Answers  


print a "hello" word without using printf n puts in c language

6 Answers  


What are identifiers and keywords in c?

0 Answers  


Fifty minutes ago if it was four times as many mints past 3 o clock. how many minutes is it to six o'clock n how....?????

3 Answers   TCS,


Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)

6 Answers   Subex,






how can i get the output 54321 4321 321 21 1 in c programming........???? pls help......

10 Answers   Infosys,


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

0 Answers   Aspire, Infogain,


What’s the special use of UNIONS?

0 Answers   ADP,


What is meant by operator precedence?

0 Answers  


What is string function c?

0 Answers  


Do you know what is the purpose of 'extern' keyword in a function declaration?

0 Answers  


what about "char *(*(*a[])())();"

3 Answers   Oracle,


Categories