C++ FEATURES – A BRIEF EXPLAINATION OF KEY FEATURES OF C++

C++ FEATURES - MOULDINGFUTURE

EXAMPLES AND FURTHER EXPLAINATION

For example, following are some of the examples of new-style headers which Standard C++ supports..

  • <iostream>
  • <fstream>
  • <string>

Furthermore, for including the new-style headers.. Certainly, we use the #include statement. Also, the only difference between the C and C++ headers is that the new-style headers don’t necessarily represent filenames.

Because C++ includes the entire C Function library i.e. each and every Function in C is already present in C++. It also supports the Standard C-style header files which are in association with that library. That is, header files such as stdio.h, ctype.h are still available. However, Standard C++ also defines new-style headers that one can use in place of these header files.

Generally, the C++ versions of the C standard headers simply add a “c” prefix to the filename. Also, they even drop the “.hextension. For example, the C++ new-style header for “math.h” is <cmath>. Another, for “string.h” is <cstring> .

Although, it is currently permissible to include C-style header files while using C library functions. But, Standard C++ don’t recommends this approach. Therefore, we generally use the new-style C++ headers in all #include statements. Somehow, if your compiler don’t support these new-style C++ headers for the C function library.. Then simply replace the old-style headers, i.e. C-like headers.

Generally, these new-style headers are just a relatively recent addition to C++. Thus, you will still find many of the older programs that don’t use new-style headers. These programs use C-style headers, specifying a filename.

Leave a comment

Your email address will not be published. Required fields are marked *

20 thoughts on “C++ FEATURES – A BRIEF EXPLAINATION OF KEY FEATURES OF C++”