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++?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what is c++

2431


Why do you use the namespace feature?

1133


Explain polymorphism?

1115


What is this weird colon-member (" : ") syntax in the constructor?

1070


Write about the use of the virtual destructor?

1057


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

1097


Mention the storage classes in c++.

1127


Describe the role of the c++ in the tradeoff of safety vs. Usability?

1271


What is singleton pattern in c++?

1045


Do you know the problem with overriding functions?

1166


Is it possible for the objects to read and write themselves?

1161


What new()is different from malloc()?

1160


What does #define mean in c++?

1342


Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1046


What do you mean by global variables?

1121