Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

CPP program to rethrow an exception

Categories: Exception Handling. 1 Comment on CPP program to rethrow an exception

In this article we will learn to implement a CPP program to rethrow an exception. A C++ program is provided below to demonstrate rethrowing an exception.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty if you’re human: Program is as follows: #include <iostream> […]

Read the rest of this entry »

CPP program for handling divide by zero exception

Categories: Exception Handling. 5 Comments on CPP program for handling divide by zero exception

In this article we will learn to implement a CPP program for handling divide by zero exception. A C++ program is provided below for handling divide by zero exception. Program is as follows: #include <iostream> using namespace std; int main() { int a, b; cout<<"Enter two integer values: "; cin>>a>>b; try { if(b == 0) […]

Read the rest of this entry »

Cpp program to create a function template to swap two numbers

Categories: Templates. No Comments on Cpp program to create a function template to swap two numbers

In this article we will learn to implement a Cpp program to create a function template to swap two numbers. A C++ program is provided below to create a function template for swapping.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty if you’re […]

Read the rest of this entry »

CPP program to create a function template for power of a number

Categories: Templates. No Comments on CPP program to create a function template for power of a number

In this article we will learn to implement a CPP program to create a function template for power of a number. A C++ program is provided below to create a function template for calculating power of a number.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave […]

Read the rest of this entry »

CPP program to illustrate member function template

Categories: Templates. No Comments on CPP program to illustrate member function template

In this article we will learn to implement a CPP program to illustrate member function template. A C++ program is provided below to illustrate member function template.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty if you’re human: Program is as follows: #include […]

Read the rest of this entry »

CPP program to illustrate class template with multiple parameters

Categories: Templates. No Comments on CPP program to illustrate class template with multiple parameters

In this article we will learn to implement a CPP program to illustrate class template with multiple parameters. A C++ program is provided below to demonstrate a template class with multiple parameters.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty if you’re human: […]

Read the rest of this entry »

CPP program to illustrate template class

Categories: Templates. No Comments on CPP program to illustrate template class

In this article we will learnt to implement a CPP program to illustrate template class. A C++ program is provided below to illustrate class template.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty if you’re human: Program is as follows: #include <iostream> using […]

Read the rest of this entry »

Pure Virtual Function Program in C++

Categories: Inheritance. No Comments on Pure Virtual Function Program in C++

In this article we will learn how to implement a pure virtual function program in C++. A C++ program is provided to illustrate the concept of pure virtual function and calculate the area of different shapes by using abstract class. Program is as follows: #include <iostream> using namespace std; class Shape { public: virtual void […]

Read the rest of this entry »

CPP program to demonstrate runtime polymorphism

Categories: Polymorphism. No Comments on CPP program to demonstrate runtime polymorphism

In this article we will look at how to implement a CPP program to demonstrate runtime polymorphism. A C++ program is provided below to illustrate runtime polymorphism. Program is as follows: #include <iostream> using namespace std; class Animal { public: virtual void sound() = 0; virtual void move() = 0; }; class Dog : public […]

Read the rest of this entry »

CPP program to show how constructors are invoked in derived class

Categories: Inheritance. No Comments on CPP program to show how constructors are invoked in derived class

In this article we will try to implement a CPP program to show how constructors are invoked in derived class. A C++ program is given below to demostrate how constructors are invoked in derived class.   Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests. Email address: Leave this field empty […]

Read the rest of this entry »