what is the difference between definition and declaration?
give me some examples.
Answers were Sorted based on User's Feedback
Answer / mohammed anas
declaration:
for example,int i;
definition:
declaration as well as initialisation is known as definition
for example int i=25;
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / code00002
A declaration introduces an identifier and describes its
type, be it a type, object, or function. A declaration is
what the compiler needs to accept references to that
identifier. These are declarations:
extern int bar;
extern int g(int, int);
double f(int, double); // extern can be omitted for function
declarations
class foo; // no extern allowed for class declarations
complete on http://answerwale.co.cc/?p=39#comment-23
Is This Answer Correct ? | 2 Yes | 3 No |
Where are local variables stored in c?
related proverb of "dont count your chicken before it hatches"
What is a c token and types of c tokens?
How can I automatically locate a programs configuration files in the same directory as the executable?
why programs in c are running with out #include<stdio.h>? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }
What is ponter?
How variables are declared in c?
main() { int x=5,y=10,z=0; x=x++ + y++; y=y++ + ++x; z=x++ + ++y; printf("%d%d%d\n",x,y,z); }
How pointer is benefit for design a data structure algorithm?
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
What does char * * argv mean in c?
main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?