how can we Declare a variable in c without defining it.
Answer Posted / 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 |
Post New Answer View All Answers
What are the different types of constants?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What are 'near' and 'far' pointers?
How to write a multi-statement macro?
What are the types of pointers?
In a byte, what is the maximum decimal number that you can accommodate?
What is scope and lifetime of a variable in c?
Does c have circular shift operators?
How to Throw some light on the splay trees?
Implement bit Array in C.
what do u mean by Direct access files? then can u explain about Direct Access Files?
Explain how do you list a file’s date and time?
Why ca not I do something like this?
Is c programming hard?