What is the difference between declaration and definition?

Answer Posted / sanjay

The definition is the one that actually allocates space,
and provides an initialization value, if any.
There can be many declarations, but there must be exactly
one definition. A definition tells the compiler to set
aside storage for the variable. A declaration makes the
variable known to parts of the program that may wish to use
it. A variable might be defined and declared in the same
statement

Is This Answer Correct ?    57 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of oop?

598


What is oops in simple words?

571


what is different between oops and c++

1992


Write a program to reverse a string using recursive function?

1784


What are the three parts of a simple empty class?

1447






Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

1998


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1409


What is oops and why we use oops?

569


What is overriding in oop?

541


What is polymorphism oop?

610


Please send ford technologies placement paper 2 my mail id

1646


How oops is better than procedural?

581


What is an interface in oop?

587


What is multilevel inheritance explain with example?

619


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2056