Declaration
The declaration, as a rule, refers to the introduction of a new name in the program. For example, you can declare a new function by describing its “signature”:
void xyz();
or declare an incomplete type:
class klass; struct ztruct;
and, just as important, declare an object:
int x;
The C ++ standard describes in §3.1 / 1 as:
An advertisement (section 7) may enter one or more names in a translation unit or the redesign names entered by previous advertisements.
Definition
A definition is a definition of a previously declared name (or it can be either a definition or a declaration). For example:
int x; void xyz() {...} class klass {...}; struct ztruct {...}; enum { x, y, z };
In particular, the C ++ standard defines it in § 3.1 / 1 as:
A declaration is a definition if it does not declare a function without specifying the function body (8.4), contains the extern specifier (7.1.1) or the binding specification 25 (7.5), and neither the initializer nor the function body, it declares a static data member in the class definition (9.2 , 9.4), this is a class name declaration (9.1), this is an opaque enum declaration (7.2), it is a template parameter (14.1), it is a parameter declaration (8.3.5) in a function declaration that is not a function definition declarator, or it is typedef declaration (7.1.3), alias declaration (7.1.3), declaration using statements (7.3.3), a static_assert declaration (section 7), an attribute declaration (section 7), an empty declaration (section 7), or a using directive (7.3.4).
Initialization
Initialization means “assigning” a value at build time. For a general object of type T it is often found in the form:
T x = i;
but in C ++ it could be:
T x(i);
or even:
T x {i};
with c ++ 11.
Conclusion
Does this mean that the definition is equal to declaration plus initialization?
It depends. What are you talking about. If you are talking about an object, for example:
int x;
This definition is without initialization. Instead, this is an initialization definition:
int x = 0;
In a certain context, it makes no sense to talk about “initialization,” “definition,” and “declaration.” If you are talking about a function, for example, initialization does not mean much.
So the answer is no : a definition does not automatically mean a declaration plus initialization.