Skip to content

Tag Archives: CPP-Functions

Function interposition is the concept of replacing calls to functions in dynamic libraries with calls to user-defined wrappers. What are applications? We can count number… Read More
Macros are pre-processed which means that all the macros would be processed before your program compiles. However, functions are not preprocessed but compiled. See the… Read More
Consider below C program. The program has extra bracket around function name. // C program to show that extra brackets with function // name work… Read More
Although polymorphism is a widely useful phenomena in C++ yet it can be quite complicated at times. For instance consider the following code snippet: #include<iostream>… Read More
A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or… Read More
In C, when we pass an array to a function say fun(), it is always treated as a pointer by fun(). Below example demonstrates the… Read More
In C, like normal data pointers (int *, char *, etc), we can have pointers to functions. Following is a simple example that shows declaration… Read More
In Java, we can use final for a function to make sure that it cannot be overridden. We can also use final in Java to… Read More
Inline function is one of the important feature of C++. So, let’s first understand why inline functions are used and what is the purpose of… Read More
Like member functions and member function arguments, the objects of a class can also be declared as const. an object declared as const cannot be… Read More
A default argument is a value provided in a function declaration that is automatically assigned by the compiler if the caller of the function doesn’t… Read More
Function overloading is a feature in C++ where two or more functions can have the same name but different parameters. When a function name is… Read More
Virtual functions are used to achieve runtime polymorphism or say late binding or dynamic binding. Inline functions are used for efficiency. The whole idea behind… Read More
Consider the following two definitions of main(). int main() {    /*  */    return 0; } and int main(void) {    /*  */    return 0; } What… Read More
  This article introduces the concept of polymorphism and virtual functions, and their use in inheritance. We’ll cover the following Definitions Without Virtual Functions Using… Read More