Skip to content

Tag Archives: C++-Function Overloading and Default Arguments

Given the dimensions of the 3D Shapes like Cube, Cuboid, or Cylinder, the task is to find the volume of all the 3D Shapes using… Read More
In this article, we will discuss how the variable-length argument works. Variadic function Calling convention Memory layout of C/C++ program Negative subscript Variadic Function: A… Read More
Function overloading is one of the important features of object-oriented programming. It allows users to have more than one function having the same name but… Read More
Prerequisite: Templates in C++ Generally, a C++ template, with a single argument looks like this: template<typename template_name> But it has been seen that a template… Read More
Just like other subroutines, overloaded subroutines are also called. To decide which function to invoke it is important to determine the number and type of… Read More
Output of following program? #include <iostream> using namespace std;    int fun(int=0, int = 0);    int main() {   cout << fun(5);   return 0; }… Read More
Predict the output of following C++ program. include<iostream> using namespace std;     class Test { protected:     int x; public:     Test (int i):x(i) { }     void… Read More
Which of the following overloaded functions are NOT allowed in C++? 1) Function declarations that differ only in the return type int fun(int x, int… Read More
Output? #include<iostream> using namespace std;    int fun(int x = 0, int y = 0, int z) {  return (x + y + z); }… Read More
Which of the following in Object Oriented Programming is supported by Function overloading and default arguments features of C++. (A) Inheritance (B) Polymorphism (C) Encapsulation… Read More

Start Your Coding Journey Now!