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...


Differentiate between declaration and definition in C++?



Differentiate between declaration and definition in C++?..

Answer / atul shankhwar

A declaration introduces a name into the program; a definition provides a unique description of an entity (e.g. type, instance, and function). Declarations can be repeated in a given scope, it introduces a name in a given scope. There must be exactly one definition of every object, function or class used in a C++ program.

A declaration is a definition unless:

 it declares a function without specifying its body,
 it contains an extern specifier and no initializer or function body,
 it is the declaration of a static class data member without a class definition,
 it is a class name definition,
 it is a typedef declaration.
A definition is a declaration unless:
 it defines a static class data member,
 it defines a non-inline member function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Adobe Interview & Adobe Placement Paper

1 Answers   Adobe,


What is singleton pattern in c++?

0 Answers  


How many lines of code you have written for a single program?

4 Answers   BoA,


Is c++ the hardest language?

0 Answers  


What is the difference between "calloc" and "malloc"?

9 Answers   ADP,


What does std mean in c++?

0 Answers  


which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

0 Answers  


How a pointer differs from a reference?

0 Answers  


without if else statement can be written ah

0 Answers  


What is a try block?

0 Answers  


What is the importance of mutable keyword?

0 Answers  


Explain public, protected, private in c++?

0 Answers  


Categories