C++ LANGUAGE – INTRODUCTION AND EXPLAINATION

C++ LANGUAGE - INTRODUCTION AND EXPLAINATION

KEY FEATURES OF C++ LANGUAGE

Now, the main differences between old-style modern code involves 2 general features..

  1. NEW STYLE HEADERS
  2. 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 */

#include<iostream.h>

int main()

{

return 0;

}

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 */

#include<iostream>

using namespace std;

int main()

{

return 0;

}

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,

THE HISTORY AND ORIGIN OF C++

OBJECT-ORIENTED PROGRAMMING – A GENERAL INTRODUCTION

Leave a comment

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

10 thoughts on “C++ LANGUAGE – INTRODUCTION AND EXPLAINATION”