Here we will see the fesetround() and fegetround() method in C++. These methods can be found in the cfenv library. The fesetround() method is used to set the specified floating point rounding direction to the current rounding direction. This is used with rint(), nearbyint() and some other rounding functions in C++. The syntax is like below − , The round can be among these FE_TONEAREST.....
In C++, we can overload functions. Some functions are normal functions; some are constant type functions. Let us see one program and its output to get the idea about the constant functions and normal functions. , , Here we can see that the normal function is called when the object is normal. When the object is constant, then the constant functions are called. If two overloaded method contai.....
In C++ and Java, there are the concept of Inheritance. The inheritance properties are used to reuse the code and also make a relationship between two objects. Here we will see some basic differences between inheritance in C++ and inheritance in Java. In Java, all of the classes are extending the Object class. So there is always a single level inheritance tree of classes. The object class is.....
Here we will see how to compile multiple cpp file in C++ program. The task is very simple. We can provide the names as a list to the g++ compiler to compile them into one executable file To compile multiple files like abc.cpp, and xyz.cpp at once, the syntax will be like this − , To run the program, we can use this − , , , ,
Enumeration is a user defined datatype in C/C++ language. It is used to assign names to the integral constants which makes a program easy to read and maintain. The keyword “enum” is used to declare an enumeration. The following is the syntax of enums. , Here, enum_name − Any name given by user. const1, const2 − These are values of type flag. The enum keyword is also .....
Here we will see how to compile C++ program using GCC (GNU C Compiler). Let us consider, we want to compile this program. , If this is a C program, we can compile with GCC like below − , But if we put c++ filename in that area, it may generate some error. , , This is not compilation error. This is linking error. To add the correct linker, we have to use –lstdc++ option. , ,
Here we will see the wprintf() and wscanf() functions in C. These are the printf() and scanf() functions for wide characters. These functions are present in the wchar.h The wprintf() function is used to print the wide character to the standard output. The wide string format may contain the format specifiers which is starting with % sign, these are replaced by the values of variables which a.....
Here we will see how to apply the multi-threading concept to search one element in an array. Here the approach is very simple. We will create some threads, then divide the array into different parts. Different thread will search in different parts. After that, when the element is found, enable the flag to identify this. , ,
Here we will see, what are the basic differences between fundamental data types and derived datatypes in C or C++. Fundamental DatatypesDerived DatatypesThe fundamental datatypes are also known as primitive datatypes.Derived datatypes are composed of fundamental datatypes.Some fundamental datatypes are int, char, float, void etc.Derived datatypes are arrays, structures, pointers etc.Integer.....
Here we will see the effect of fork() and exec() system call in C. The fork is used to create a new process by duplicating the calling process. The new process is the child process. See the following property. The child process has its own unique process id.The parent process id of the child process is same as the process id of the calling process.The child process does not inherit the pare.....
Sign up now to get your own personalized profile!
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more