Here we will see how the preprocessors are working in C or C++. Let us see what are the preprocessors. The preprocessors are the directives, which give instructions to the compiler to preprocess the information before actual compilation starts. All preprocessor directives begin with #, and only white-space characters may appear before a preprocessor directive on a line. Preprocessor directi.....
Here we will see what are the differences between int and const_int& in C or C++. The int is basically the type of integer type data. And const is used to make something constant. If there is int& constant, then it indicates that this will hold the reference of some int type data. This reference value is constant itself. So the const is redundant. The compiler may return warning or .....
Here we will see what are the differences between __FUNCTION__, __func__ and the __PRETTY_FUNCTION__ in C++. Basically the __FUNCTION__ and __func__ are same. Some old versions of C and C++ supports __func__. This macro is used to get the name of the current function. The _PRETTY_FUNCTION__ is used to return the detail about the function. Using this we can get which function is used, and in.....
Here we will see what are the __FILE, __LINE__ and __FUNCTION__ in C++. This macro is used to get the path of the current file. This is useful when we want to generate log files. The following code will explain its functionality. , , This macro can find the current line number in source file. This line number is an integer value. When log statements are generating then __LINE__ plays some u.....
In C++ we have seen there is character type data called char. Sometimes we have seen unsigned char also. So here we will see what is basically the unsigned char means. What are the basic differences between signed char and unsigned char? Signed char and unsigned char both are used to store single character. The variable stores the ASCII value of the characters. For an example if ‘A&rs.....
At first let us discuss about the rand() function. rand() function is a predefined method of C++. It is declared in <stdlib.h> header file. rand() is used to generate random number within a range. Here min_n is the minimum range of the random numbers and max_n is the maximum range of the numbers. So rand() will return the random numbers between min_n to (max_n – 1) inclusive of .....
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