Skip to content

Tag Archives: CPP-Functions

The bitset::all() is a built-in function in C++ STL which returns True if all bits are set in the binary representation of a number if… Read More
bitset::flip() is a built-in STL in C++ which flips the bits. If no parameter is passed in the function, then it flips all the bit… Read More
bitset::none() is a built-in STL in C++ which returns True if none of its bits are set. It returns False if a minimum of one… Read More
bitset::count() is an inbuilt STL in C++ which returns the number of set bits in the binary representation of a number. Syntax: int count() Parameter:… Read More
bitset::size() is a built-in STL in C++ which returns the total number of bits.  Syntax:   bitset_name.size() Parameter: The function accepts no parameter.  Return Value: The… Read More
count_if() function returns the number of elements in a range that satisfy the condition. Examples: Input: 0 1 2 3 4 5 6 7 8… Read More
The fdim() function takes two arguments and returns the positive difference between first and second argument. This function returns a-b if a>b otherwise returns 0.… Read More
The std::cbrt() is an inbuilt function in C++ STL which is used to calculate the cube root of number. It accepts a number as argument… Read More
A callback is any executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at… Read More
Function Overloading (achieved at compile time) It provides multiple definitions of the function by changing signature i.e changing number of parameters, change datatype of parameters,… Read More
The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more… Read More
Void functions are “void” due to the fact that they are not supposed to return values. True, but not completely. We cannot return values but… Read More
There can be some instances where you need to return multiple values (may be of different data types ) while solving a problem. One method… Read More
Consider the following program. Predict the output of it when compiled with C and C++ compilers. void func() {     /* definition */ }    int… Read More
Please note that the title is Functors (Not Functions)!! Consider a function that takes only one argument. However, while calling this function we have a… Read More