Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

C++ Program to Solve a Matching Problem for a Given Specific Case

Answered on 3rd May, 2019, 0 Views

This is a C++ Program to solve a matching problem for a Given Specific Case. Here, N men and N women are given, each person has ranked all members of the opposite gender in order of preference, marry the men and women together such that there are no two people of opposite gender who would both rather have each other than their current partners. All the marriages are “stable”, if.....

C++ program to Solve Tower of Hanoi Problem using Binary Value

Answered on 3rd May, 2019, 0 Views

This C++ program displays the solution to the Tower of Hanoi problem using binary value. There is one binary digit for each disk. The most significant bit represents the largest disk. A value of 0 indicates that the largest disk is on the initial peg, while a 1 indicates that it’s on the final peg. The bitstring is read from left to right, and each bit can be used to determine the loc.....

Anything written in sizeof() is never executed in C

Answered on 2nd May, 2019, 0 Views

The sizeof function (Sometimes called operator) is used to calculate the size of the given argument. If some other functions are given as argument, then that will not be executed in the sizeof. In the following example we will put one printf() statement inside the loop. Then we will see the output. , , The printf() is not executed which is present inside the sizeof(). Only the return type i.....

Count the number of objects using Static member function in C++

Answered on 2nd May, 2019, 0 Views

Here we will see how to count number of objects are created from a specific class using some static member functions. The static members are class properties, not the object properties. For a single class there will be only one instance for static members. No new members are created for each objects. In this problem we are using one static counter variable to keep track the number of object.....

Why “using namespace std” is considered bad practice in C++

Answered on 2nd May, 2019, 0 Views

C++ has a standard library that contains common functionality you use in building your applications like containers, algorithms, etc. If names used by these were out in the open, for example, if they defined a queue class globally, you'd never be able to use the same name again without conflicts. So they created a namespace, std to contain this change. The using namespace statement just mea.....

remainder() in C++

Answered on 2nd May, 2019, 0 Views

Here we will see the functionality of remainder() method of C++. The remainder() function is used to compute the floating point remainder of numerator/denominator. So the remainder(x, y) will be like below. , The rquote is the value of x/y. This is rounded towards the nearest integral value. This function takes two arguments of type double, float, long double, and returns the remainder of t.....

ldexp() function in C/C++

Answered on 2nd May, 2019, 0 Views

Here we will see what is the use of ldexp() method in C or C++. This function returns any variable x raise to the power of exp value. This takes two arguments x and exp. The syntax is like below. , Now let us see one example to get a better idea. , , Now let us see some errors that can be generated from this function. If the return value is too large to represent then this function will ret.....

C qsort() vs C++ sort()

Answered on 2nd May, 2019, 0 Views

Here we will see what are the differences between qsort() in C, and sort() in C++. The C provides qsort() function, that can be used for sorting an array. The function arguments and syntax is like below. , This function takes the base address of that array, the number of elements of that array. Size of each item in the array, and a comparator function. The C++ provides sort() function. This.....

loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.