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

Catch block and type conversion in C++

Answered on 2nd May, 2019, 0 Views

In this section, we will see how to use the catch block for exception handling and the type conversion in C++. At first, let us see a code, and we will see what will be the output, and how they are generating. , , So, what is the reason behind this. Why this kind of output is generating? As we can see the character ‘a’ is thrown, but the first catch block is for int. If we think.....

Lexicographically next permutation in C++

Answered on 2nd May, 2019, 0 Views

Here we will see how to generate lexicographically next permutation of a string in C++. The lexicographically next permutation is basically the greater permutation. For example, the next of “ACB” will be “BAC”. In some cases, the lexicographically next permutation is not present, like “BBB” or “DCBA” etc. In C++ we can do it by using a library.....

What is the use of `%p` in printf in C?

Answered on 2nd May, 2019, 0 Views

In C we have seen different format specifiers. Here we will see another format specifier called %p. This is used to print the pointer type data. Let us see the example to get a better idea. , ,

How to use Reference Parameters in C++?

Answered on 2nd May, 2019, 0 Views

Here we will see how to pass reference of some variable in C++. Sometimes we call it as “Call by Reference”. The call by reference method of passing arguments to a function copies the reference of an argument into the formal parameter. Inside the function, the reference is used to access the actual argument used in the call. This means that changes made to the parameter affect t.....

How to find the size of an int[] in C/C++?

Answered on 2nd May, 2019, 0 Views

In this section, we will see how we can get the size of an integer array in C or C++? The size of int[] is basically counting the number of elements inside that array. To get this we can use the sizeof() operator. If the array name is passed inside the sizeof(), then it will return total size of memory blocks that are occupied by the array. Now if we divide it by the size of each element, t.....

Program to display hostname and IP address C

Answered on 2nd May, 2019, 0 Views

In this section we will see how to see the Host name and IP address of the local system in an easier way. We will write a C program to find the host name and IP. Some of the following functions are used. These functions have a different task. Let us see the functions and their tasks. FunctionDescriptiongethostname()It finds the standard host name for the local computer.gethostbyname()It fin.....

setjump() and longjump() in C

Answered on 2nd May, 2019, 0 Views

In this section, we will see what are the setjump and longjump in C. The setjump() and longjump() is located at setjmp.h library. The syntax of these two functions is like below. , These are used in C for exception handling. The setjump() can be used as try block, and longjump() can be used as throw statement. The longjump() transfers control the pointe which is pointed by setjump(). Here w.....

Write a one line C function to round floating point numbers

Answered on 2nd May, 2019, 0 Views

Here we will see how to write one-line C function, that can round floating point numbers. To solve this problem, we have to follow these steps. Take the numberif the number is positive, then add 0.5Otherwise, subtract 0.5Convert the floating point value to an integer using typecasting, ,

Remove function in C/C++

Answered on 30th Apr, 2019, 0 Views

The C library function int remove(const char *filename) deletes the given filename so that it is no longer accessible. Following is the declaration for remove() function. , This function takes the filename. This is the C string containing the name of the file to be deleted. On success, zero is returned. On error, -1 is returned, and errno is set appropriately. , Let us assume we have a.....

Restrict keyword in C

Answered on 30th Apr, 2019, 0 Views

Here we will see what is the restrict keyword in C. The restrict keyword first introduced in C99 version. Let us see what is actually this restrict keyword. The restrict keyword is used for pointer declarations as a type quantifier of the pointer. This keyword does not add new functionalities. Using this the programmer can inform about an optimization that compiler can make. When the restri.....

Previous 1 ... 3 4 5 6 7 8 9 ... 37 Next
loader
Advertisements
Contribution

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