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 |
Can the curly brackets { } be used to enclose a single line of code?
What is array of structure in c programming?
Write a C++ program to give the number of days in each month according to what the user entered. example: the user enters June the program must count number of days from January up to June
develop algorithms to add polynomials (i) in one variable
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 }
how to convert an char array to decimal array
What does the format %10.2 mean when included in a printf statement?
How does free() know explain how much memory to release?
4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
compare array with pointer?
Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.
How can I recover the file name given an open stream?