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 are compilers in c++?

1070


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

3649


How do you sort a sort function in c++ to sort in descending order?

998


Which programming language's unsatisfactory performance led to the discovery of c++?

1336


Should the this pointer can be used in the constructor?

1027


Explain the operation of overloading of an assignment operator.

1173


Explain the difference between static and dynamic binding of functions?

1075


What is a tree in c++?

974


What do you mean by funtion prototype?

1083


What is a c++ object?

1176


What is a manipulator in c++?

1237


Explain Text Manipulation Routines?

1082


Explain what is polymorphism in c++?

1129


what is the difference between overloading & overriding? give example.

1195


What is malloc in c++?

1018