Ayush Gupta has Published 527 Articles

Conversion of whole String to uppercase or lowercase using STL in C++

Ayush Gupta

Ayush Gupta

Updated on 16-Mar-2020 09:47:51

5K+ Views

In this tutorial, we will be discussing a program to understand conversion of whole string to uppercase or lowercase using STL in C++.To perform this transformation, C++ STL provides toupper() and tolower() functions to convert to uppercase and lowercase respectively.Example Live Demo#include using namespace std; int main(){    string su = ... Read More

Virtual Function in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:40:10

2K+ Views

In this tutorial, we will be discussing a program to understand virtual functions in C++.Virtual function is the member function defined in the base class and can further be defined in the child class as well. While calling the derived class, the overwritten function will be called.Example Live Demo#include using ... Read More

Virtual destruction using shared_ptr in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:36:51

208 Views

In this tutorial, we will be discussing a program to understand virtual destruction using shared_ptr in C++.To delete the instances of a class, we define the destructor of the base class to be virtual. So it deletes the various object instances inherited in the reverse order in which they were ... Read More

Virtual base class in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:34:40

17K+ Views

In this tutorial, we will be discussing a program to understand virtual base class in C++.Virtual classes are primarily used during multiple inheritance. To avoid, multiple instances of the same class being taken to the same class which later causes ambiguity, virtual classes are used.Example Live Demo#include using namespace std; ... Read More

Using class to implement Vector Quantities in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:28:56

219 Views

In this tutorial, we will be discussing a program to understand how to use class to implement vector quantities in C++.Vector quantities are the ones which have both magnitude and direction. Here we will be implementing them using classes and then performing basic operations on them.Example Live Demo#include #include ... Read More

Trivial classes in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:22:23

510 Views

In this tutorial, we will be discussing a program to understand trivial classes in C++.When a class/ struct contains explicitly defaulted value inside it, then it is known as Trivial classes. Further trivial classes have their own constructor, assignment operator and destructor.Example//using the default constructor struct Trivial {    int ... Read More

transform_inclusive_scan() function in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:19:56

93 Views

In this tutorial, we will be discussing a program to understand the transform_inclusive_scan() function in C++.Example Live Demo#include #include using namespace std; namespace point_input_iterator {    template    OutputItrator transform_inclusive_scan(InputItrator first,       InputItrator last,       OutputItrator d_first,       BinaryOperation binary_op,   ... Read More

Thread get_id() function in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:15:40

217 Views

In this tutorial, we will be discussing a program to understand thread get_id() function in C++.Thread get_id() function verifies the current state of the process and then returns the id for the current thread in execution. This function doesn’t take any parameters.Example#include #include #include using namespace std; ... Read More

Containership in C++

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:08:55

2K+ Views

In this tutorial, we will be discussing a program to understand containership in C++.The parameter if a certain class contains another class is called as containership. The inside class is called contained class, while the class in which it is present is called container class.Example Live Demo#include using namespace std; ... Read More

Constructors in C++ Programming

Ayush Gupta

Ayush Gupta

Updated on 12-Mar-2020 06:02:08

700 Views

In this tutorial, we will be discussing a program to understand constructors in C++.Constructors are member functions of the classes which initiates the object instance creation. They have the same name as the parent class and don’t have any return type.Default constructorsExample Live Demo#include using namespace std; class construct { ... Read More

Advertisements