how can we Declare a variable in c without defining it.
Answer / manoj
By using EXTRN.
Example:
File 1:
int GlobalVariable; // implicit definition
void SomeFunction(); // function prototype
(declaration)
int main() {
GlobalVariable = 1;
SomeFunction();
return 0;
}
File 2:
extern int GlobalVariable; // explicit declaration
void SomeFunction() { // function header (definition)
++GlobalVariable;
}
| Is This Answer Correct ? | 6 Yes | 1 No |
How to use c/c++ code in JAVA
10 Answers CDAC, IBM, Satyam, Scope International,
What do you understand by normalization of pointers?
write a program to find the number of even integers and odd integers in a given array in c language
13 Answers IAI Cameroun, NIIT, Olive Tech, QIS,
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program
19 Answers CTS, HCL, TCS,
How to set file pointer to beginning c?
why TCS selected more student in the software field from all institution.
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Which is the best sort method for library management?
What is volatile
struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā%dā,s.x); }
Explain union.
Is struct oop?