Lecture3 05august CAP202
Lecture3 05august CAP202
C++
No. C C++
1) C follows the procedural style programming. C++ is multi-paradigm. It supports both procedural and object oriented.
2) Data is less secured in C. In C++, you can use modifiers for class members to make it inaccessible for outside users.
5) In C, you can't use functions in structure. In C++, you can use functions in structure.
7) In C, scanf() and printf() are mainly used for C++ mainly uses stream cin and cout to perform input and output operations.
input/output.
9) C programs are divided into procedures and modules C++ programs are divided into functions and classes.
10) C does not provide the feature of namespace. C++ supports the feature of namespace.
11) Exception handling is not easy in C. It has to perform C++ provides exception handling using Try and Catch block.
using other functions.
As C is a structured programming
language, the program is divided into As C++ is an object-oriented
Program Division blocks known as functions which can be programming language, the code
viewed as individual components of the consists of Objects and Classes.
program.
C is the foundational language and, hence, C++ is the superset of the C language
Compatibility the code written with C can be run with including OOP concepts and hence,
the C++ compiler. cannot run the code in the C compiler.