In this tutorial we shall learn about below topics 1. Introduction to Function template 2. Syntax for function template: 3. Example for simple function template 4. Function Template with more arguments 5. Overloading function template 6. Recursion with function template 1. Introduction to Function template …
In this chapter we shall learn about below topics: 1. Introduction 2. Declaring namespaces 3. Accessing namespace using “using” directive 4. The global namespace 5. The std namespace 6. Nested namespaces 7. Inline namespaces (C++ 11) 8. Namespace aliases 9. Anonymous or unnamed namespaces 10. Discontiguous …
Need for virtual destructor. When you delete a derived class object by using a base class pointer, the destructor call will be an undefined behavior. For example: In the below code, we are creating an object of derived class and assigning to base class pointer. Now …
In this tutorial we shall see what is object slicing in C++ Few points related to object slicing: Object Slicing occurs when a derived class object is assigned to the base class object. Then, an instance of derived class object is copied into the base class …