The C++ standard has this to say about dynamic initialisation:
"Objects with static storage duration shall be zero-initialised before any other initialisation takes place. Zero-initialisation and initialisation with a constant expression are collectively called static initialisation; all other initialisation is dynamic initialisation."
In C++, overriding and function, method, or operator is a different thing than (dynamic) polymorphism, so overriding a polymorphic method is almost entirely possible.
When you assign a value to a variable that already exists, then it is always considered an assignment, otherwise it is considered an initialisation. The main difference is that an initialisation must instantiate a resource to hold the value, whereas the resource already exists with an assignment. In some cases (especially with badly-designed objects), initialisation may in fact be a two-stage process where, behind the scenes, the resource is first instantiated in an uninitialised or default state before being assigned a value through an assignment operator. C, for instance, always uses a two-stage initialisation whereas C++ can use a one-stage initialisation which is more efficient.
Class initialisation is normally handled by the class constructor(s). Every constructor has an optional initialisation section between the declaration and the body of the constructor. This is generally used to call specific base class constructors, but can be used to initialise any member variables via their own constructors. Member variables may alternatively be initialised in the body of the constructor, but this is really only necessary when member pointers need to be allocated new memory. For those classes that have many members and many constructors, the initialisation may be handled by a private member method called by each constructor in order to simplify maintenance during development. However, when the class is finalised, the private member method will generally be replaced with formal initialisation sections in each constructor.
There is no difference, other than that declarations in C++ can also initialise the variable in a single instruction. C example: int x; // declaration x=5; // initialisation C++ example: int y=5; // declaration and initialisation combined.
Separators include commas, colons, semi-colons and white-space. Semi-colons are used to indicate the end of a code block or to separate one function from the next. Commas are used to separate function arguments, or to separate structure variables and class member initialisation lists (comma-separated lists). Colons are mainly used to signify class inheritance and the start of class initialisation segments. White-space separates a variable type from its name, but is also used to aid the readability of code.
Initialization of objects means to provide an initial value for the object. This is usually done by the constructor, or it can be done with an assignment statement.
Static binding occurs at compile time. Dynamic binding occurs at runtime.
In C++, overriding and function, method, or operator is a different thing than (dynamic) polymorphism, so overriding a polymorphic method is almost entirely possible.
Yes and no. Static vs dynamic binding is not a C or C++ language issue; it is a linker issue. If you link with a .lib file that contains stubs for run-time loading, then the called routine will not be loaded until it is invoked, and it will not be made a part of the load module.
No, C++ does not use dynamic memory management. The programmer is entirely responsible for releasing dynamic memory when it is no longer required. When static objects fall from scope, their destructors are called automatically, but there is no automatic garbage collection for dynamic objects. Allocated memory remains allocated until the programmer manually releases it, or the thread that owns the memory is terminated.
1.Classes and Objects 2.Constructors and Destructors 3.Inheritance 4.Polymorphism 5.Dynamic Binding
Dynamic binding is achieved via virtual functions and the virtual table that is associated with every class that declares or inherits a virtual function. The virtual table (or v-table) maps every virtual function (including pure-virtual functions) to a function pointer that points to the most-derived overload. This makes it possible to invoke specific behaviour even when the runtime type of the object is unknown to the caller.
When you assign a value to a variable that already exists, then it is always considered an assignment, otherwise it is considered an initialisation. The main difference is that an initialisation must instantiate a resource to hold the value, whereas the resource already exists with an assignment. In some cases (especially with badly-designed objects), initialisation may in fact be a two-stage process where, behind the scenes, the resource is first instantiated in an uninitialised or default state before being assigned a value through an assignment operator. C, for instance, always uses a two-stage initialisation whereas C++ can use a one-stage initialisation which is more efficient.
Class initialisation is normally handled by the class constructor(s). Every constructor has an optional initialisation section between the declaration and the body of the constructor. This is generally used to call specific base class constructors, but can be used to initialise any member variables via their own constructors. Member variables may alternatively be initialised in the body of the constructor, but this is really only necessary when member pointers need to be allocated new memory. For those classes that have many members and many constructors, the initialisation may be handled by a private member method called by each constructor in order to simplify maintenance during development. However, when the class is finalised, the private member method will generally be replaced with formal initialisation sections in each constructor.
There is no difference, other than that declarations in C++ can also initialise the variable in a single instruction. C example: int x; // declaration x=5; // initialisation C++ example: int y=5; // declaration and initialisation combined.
Generally speaking, no. 3D animation is achieved with 3D animation software and scripts. The software may be largely implemented in C++, but that's not the same thing as creating 3D animations.
Separators include commas, colons, semi-colons and white-space. Semi-colons are used to indicate the end of a code block or to separate one function from the next. Commas are used to separate function arguments, or to separate structure variables and class member initialisation lists (comma-separated lists). Colons are mainly used to signify class inheritance and the start of class initialisation segments. White-space separates a variable type from its name, but is also used to aid the readability of code.