Skip to content
Gblog 100 Days of Code – A Complete Guide For Beginners and Experienced
Do you want to become a successful software developer and dreaming about getting into the big tech companies? Are you someone who is already working… Read More
Prerequisite: Pre-increment and post-increment in C/C++ In C++, pre-increment (or pre-decrement) can be used as l-value, but post-increment (or post-decrement) can not be used as… Read More
In C++, following are the general rules for operator overloading. 1) Only built-in operators can be overloaded. New operators can not be created. 2) Arity… Read More
C++
In C++, assignment operator should be overloaded with self assignment check. For example, consider the following class Array and overloaded assignment operator function without self… Read More
C++
  Deleting a derived class object using a pointer of base class type that has a non-virtual destructor results in undefined behavior. To correct this… Read More
Predict the output of below C++ programs. Question 1 #include<iostream> using namespace std;   class A {   public:     A(int ii = 0) : i(ii) {}… Read More
A virtual function is a member function of a base class that is overridden by a derived class. When you use a pointer or a… Read More
C++
Pre-requisite: Type Conversion in C++ and Use of explicit keyword in C++  A conversion constructor is a single-parameter constructor that is declared without the function… Read More
C++
Inheritance in C++: This is an OOPS concept. It allows creating classes that are derived from other classes so that they automatically include some of… Read More
C++
Write a function to generate all possible n pairs of balanced parentheses.  Examples:  Input: n=1 Output: {} Explanation: This the only sequence of balanced parenthesis… Read More
In C++, RTTI (Run-time type information) is a mechanism that exposes information about an object’s data type at runtime and is available only for the… Read More
C++
In C++, class variables are initialized in the same order as they appear in the class declaration. Consider the below code. #include<iostream>    using namespace… Read More
Given a root of a tree, and an integer k. Print all the nodes which are at k distance from root. For example, in the below… Read More
In C printf(), %n is a special format specifier which instead of printing something causes printf() to load the variable pointed by the corresponding argument… Read More
Method 1 (Using Nested Loops): We can calculate power by using repeated addition. For example to calculate 5^6.  1) First 5 times add 5, we get… Read More
Ideally delete operator should not be used for this pointer. However, if used, then following points must be considered.1) delete operator works only for objects… Read More

Start Your Coding Journey Now!