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 |
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
What is the argument of a function in c?
Write a program to print prime nums from 1-20 using c programing?
f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Reverse a string word by word??
if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water?
main() { int i=5; printf("%d%d%d%d",i++,i--,i); }
What is function pointer and where we will use it
hello everybody can we change a the adress of a variabl i mean can i put for exemple for a int *p: &p=6 ?????????
What does typeof return in c?