Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between declaration and definition?

Answer Posted / rajesh manem

Ans: The declaration is means the memory is not yet all to
be allocated..
For example:
Int a; //is it declaration? Or definition?
Just check this
Int main()
{
Int I;
Printf(ā€œ%dā€,i);
}
It prints the garbage value that means the memory is
allocated for this declaration so we can say that this int I
is both declaration and definition.
And take another example extern int I -- declaration
because no memory is allocated.
Similarly for function prototypes all are declarations.
In the case of class declaration String s; // Declaration
[because reference is created]
When the new keyweord encounters then it is definition
String *s=new Stirng(); //declaration and
definition

Is This Answer Correct ?    38 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two different types of polymorphism?

1147


Can bst contain duplicates?

1198


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2320


What is the example of polymorphism?

1132


What is overriding in oop?

1044


Is enum a class?

1068


What is class and object in oops?

1147


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

1863


What is coupling in oop?

1035


What is encapsulation in oop?

1054


What polymorphism means?

1079


What is encapsulation in oops?

1015


Can we create object of abstract class?

1099


What is static in oop?

1081


Can abstract class have normal methods?

1051