C++ FEATURES – A BRIEF EXPLAINATION
C++ FEATURES –
In the previous post, all of us got knowledge about the Introduction to C++ Language.. Furthermore, The differences between C and C++ Language.. Finally, the differences between the Old-style C++ and Modern C++ Language. Now, let’s have a look on the C++ features.. That means the key features of C++ that differenciate it from C Language.
Generally, C++ involves 2 specific features which differenciate it from the C Language.. They are as follows,
- NEW C++ HEADERS
- THE NAMESPACE STATEMENT
Now, let’s have a close look at both of the C++ Features..
1. THE NEW C++ HEADERS –
Generally, we all know that whenever we use a library function in a program, we must include its header. Certainly, it happens by the use of #include statement. For example, in C Language.. If one wants to include the header for the Input-Output functions.. Then one must include stdio.h with statement like this..
Certainly, stdio.h is the name of the file which Input-Output functions use. Also, the preceding statement causes the program to include that particular file. Furthermore, the key point is that this #include statement generally includes a file.
Earlier, during the initial days and for several years after the Invention of C++ Language.. C++ did use the same style of headers as C Language. That is, the Programmers were using header files. Furthermore, Standard C++ still supports the C-style headers for header files you create. Also, there is a specific purpose of using these header files till now, i.e. for backward compatibility.
However, Standard C++ represents a new kind header that one can use by the Standard C++ library. Certainly, the new-style headers don’t specify filenames. Instead, they generally specify standard Identifiers that may be in mapping to files by the compiler. Although, they need not be.
Especially relevant, the new-style C++ headers are an abstraction. These simply guarantee that the appropriate prototypes and definitions that C++ library requires, have their declaration done.
Since, the new-style headers are not filenames. Thus, there’s no presence of “.h” extension. Furthermore, they consist only of the header name present between angle brackets.