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

Explain what is page thrashing?

0 Answers  


What is a protocol in c?

0 Answers  


write a program for fibonaci series by using while loop in c?

2 Answers  


what is difference between C and C++

4 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }

3 Answers  






Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  


code for inverse a matrix

0 Answers  


What is union in c?

0 Answers  


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

0 Answers  


Difference between constant pointer and pointer to a constant.

0 Answers   Huawei,


HOW TO ANSWER IF ASKED " WHAT KIND OF A PERSON ARE YOU?" I NEED AN ANSWER THAT IMPRESS THE INTERVIEWER

4 Answers  


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


Categories