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 |
What do you mean by keywords in c?
main() { int a[10]; printf("%d",*a+1-*a+3); }
What does 2n 4c mean?
find second largest element in array w/o using sorting techniques? use onle one for loop.
15 Answers BitWise, Zycus Infotech,
What's wrong with "char *p = malloc(10);" ?
What is the use of linkage in c language?
What is pointer and structure in c?
What is "Hungarian Notation"?
What are the different types of storage classes in C?
why java is called as a purely oops language.
main() { char *ptr = "Ramco Systems"; (*ptr)++; printf("%s\n",ptr); ptr++; printf("%s\n",ptr); } Find the Outputs?
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?