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 can I sort a linked list?
Tell me when is a void pointer used?
What does a function declared as pascal do differently?
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
what is a function method?give example?
What is this infamous null pointer, anyway?
program for validity of triangle from 3 side
what does exit() do?
How do you define a function?
Is there a way to jump out of a function or functions?
How to delete a node from linked list w/o using collectons?
What the advantages of using Unions?