KEY FEATURES OF C++ LANGUAGE –
Now, the main differences between old-style modern code involves 2 general features..
- NEW STYLE HEADERS
- THE NAMESPACE STATEMENT
Furthermore, to understand the differences.. We will start by taking example of 2 versions of an easy , do-nothing C++ Program. The First version is as follows :
/* AN OLD-STYLE C++ PROGRAM */
Especially relevant, one should pay a special attention to the #include statement. Why!? Because it includes the file iostream.h , not the header <iostream> . Also, there’s no namespace statement present in the above example.
Now, here is another version of simple C++ program which uses the modern style..
/* A modern-style C++ Program that uses the modern-style headers and a namespace */
using namespace std;
Generally, this modern version uses the C++ – style header and specifies a namespace.. Both of the features i.e. C++ – style headers and namespace are important and unique features of C++ Language.
Now, we will be covering the 2 C++ features that are C++ style headers and namespace.. In brief in the very next post..
Thus, it was all about C++ LANGUAGE – INTRODUCTION AND EXPLAINATION.. For more information regarding any other C++ post.. Click on,