what is the difference between definition and declaration?
give me some examples.

Answers were Sorted based on User's Feedback



what is the difference between definition and declaration? give me some examples...

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

what is the difference between definition and declaration? give me some examples...

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

Post New Answer

More C Interview Questions

Where are local variables stored in c?

0 Answers  


related proverb of "dont count your chicken before it hatches"

1 Answers  


What is a c token and types of c tokens?

0 Answers  


How can I automatically locate a programs configuration files in the same directory as the executable?

0 Answers  


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 "); }

0 Answers  






What is ponter?

0 Answers   TCS,


How variables are declared in c?

0 Answers  


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); }

1 Answers   CodeChef,


How pointer is benefit for design a data structure algorithm?

2 Answers  


main() { char *p; p="Hello"; printf("%c\n",*&*p); }

2 Answers   ME,


What does char * * argv mean in c?

0 Answers  


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?

1 Answers   GATE,


Categories