0% found this document useful (0 votes)
11 views

C Vs C++

C is a procedural programming language that uses functions as building blocks and focuses on steps to solve problems. Data is not secured and variables must be defined at the beginning of functions. C follows a top-down approach, uses scanf() and printf() for input/output, and supports built-in data types. Programs are divided into modules and functions. C++ is an object-oriented language that uses objects as building blocks and focuses on objects rather than procedures. Data is hidden and variables can be defined anywhere in functions. C++ follows a bottom-up approach, uses cin>> and cout<< for input/output, and supports built-in and user-defined data types. Programs are divided into classes

Uploaded by

ad599066
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

C Vs C++

C is a procedural programming language that uses functions as building blocks and focuses on steps to solve problems. Data is not secured and variables must be defined at the beginning of functions. C follows a top-down approach, uses scanf() and printf() for input/output, and supports built-in data types. Programs are divided into modules and functions. C++ is an object-oriented language that uses objects as building blocks and focuses on objects rather than procedures. Data is hidden and variables can be defined anywhere in functions. C++ follows a bottom-up approach, uses cin>> and cout<< for input/output, and supports built-in and user-defined data types. Programs are divided into classes

Uploaded by

ad599066
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C Vs C++

S.
C C++
No.
C is a structural or procedural programming C++ is an object oriented programming
language. language.
1
Emphasis is on procedure or steps to solve
Emphasis is on objects rather than procedure.
any problem.
2
Functions are the fundamental building
Objects are the fundamental building blocks.
blocks.
3
Data is hidden and can’t be accessed by
In C, the data is not secured.
external functions.
4

C follows top down approach. C++ follows bottom up approach


5
C uses scanf() and printf() function for C++ uses cin>> and cout<< for standard input
standard input and output. and output.
6
Variables must be defined at the beginning in Variables can be defined anywhere in the
the function. function.
7
Contd..
C is a middle level language. C++ is a high level language.
9
Programs are divided into modules and Programs are divided into classes and
10 functions. functions.
C doesn’t support exception handling directly. C++ supports exception handling. Done by
11 Can be done by using some other functions. using try and catch block.
Features like function overloading and C++ supports function overloading and
12 operator overloading is not present. operator overloading.
C++ program file is saved with .CPP
C program file is saved with .C extension.
13 extension.
Mapping between Data and Function is Mapping between Data and Function can be
14 difficult and complicated. used using "Objects"
In C, we can call main() Function through In C++, we cannot call main() Function
15 other Functions through other functions.
It support both built-in and user define data
It supports built-in and primitive data types.
16 types.
In C, malloc() and calloc() Functions are In C++, new and delete operators are used
used for Memory Allocation and free() for Memory Allocating and Deallocating.
17 function for memory Deallocating.

main() does not return any value main() returns integer value
18.

Structure contains only data Structure contains data and method


19.

You might also like