Introduction to C++

 Introduction to C++:

C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. The name is “C++" is a syntactic construct used in C (to increment a variable), and C++ is intended as an incremental improvement of C. Most of C is a subset of C++, so that most C programs can be compiled using a C++ compiler. C++ is object oriented and updated version of C. Earlier C++ was known as C with classes. In C++, the major change was the addition of classes and a mechanism for inheriting class objects into other classes. C++ expressions are the same as C expressions.  All C operators are valid in C++. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.

Difference between C & C++ :

C Language

C++ Language

1. C is Procedural Language.

1. C++ is non Procedural i.e Object oriented Language.

2. No virtual Functions are present in C

2. The concept of virtual Functions are used in C++.

3. In C, Polymorphism is not possible.

3. The concept of polymorphism is used in C++.

4. Operator overloading is not possible in C.

4. Operator overloading is one of the greatest Feature of C++.

5. Top down approach is used in Program Design.

5. Bottom up approach adopted in Program Design.

6. No namespace Feature is present in C Language.

6. Namespace Feature is present in C++ for avoiding Name collision.

7. Multiple Declaration of global variables are allowed.

7. Multiple Declaration of global varioables are not allowed.

8. In C

          scanf() Function used for Input.

          printf() Function used for output.

8. In C++

         cin>> Function used for Input.

         cout<< Function used for output.

9. Mapping between Data and Function is difficult and complicated.

9. Mapping between Data and Function can be used using "Objects"

10. In C, we can call main() Function through other Functions

10. In C++, we cannot call main() Function through other functions.

11. C requires all the variables to be defined at the starting of a scope.

11. C++ allows the declaration of variable anywhere in the scope i.e at time of its First use.

12. No inheritance is possible in C.

12. Inheritance is possible in C++

13. In C, malloc() and calloc() Functions are used for Memory Allocation and free() function for memory Deallocating.

13.In C++,  new and delete operators are used for Memory Allocating and Deallocating.

14. It supports built-in and primitive data types.

14. It support both built-in and user define data types.

15. In C, Exception Handling is not present.

15. In C++, Exception Handling is done with Try and Catch block.

 

Benefits of C++:

·        C++ is a highly portable language and is often the language of choice for multi-device, multi-platform app development.

·  C++ is an object-oriented programming language and includes classes, inheritance, polymorphism, data abstraction and encapsulation.

·        C++ has a rich function library.

·        C++ allows exception handling, and function overloading which are not possible in C.

·        C++ is a powerful, efficient and fast language. It finds a wide range of applications – from GUI applications to 3D graphics for games to real-time mathematical simulations.

Applications of C++:

Using C++, you can develop system software like OS, Device Drivers, Network(N/W) protocols, PC – utilities

Application software you can develop application like:

·        Database

·        Word processing

·        Spreadsheets

·        C++ is a general purpose programming language better than ‘c’.

·        General purpose means it is suitable for developing any software.

CUI means a character user interface

Comments

Popular posts from this blog

Tokens in C++

Variables in C++

Data Types in C++