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 |
Are strings mutable in c++?
What are the two main components of c++?
What is an action class?
Difference between a homogeneous and a heterogeneous container
What is heap sort in c++?
What is private public protected in c++?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What is a null object in c++?
What is iterator in c++?
What is a container class? What are the types of container classes in c++?
how many trys can we write in one class
Is map ordered c++?