Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views6 pages

Difference Between C and C++ - GeeksforGeeks

The document outlines the key differences between the C and C++ programming languages, highlighting aspects such as exception handling, access modifiers, type checking, and file extensions. C++ supports features like strict type checking and exception handling, which are not present in C. Additionally, C++ allows for named initializers to appear out of order and supports meta-programming through templates.

Uploaded by

amolpatil30990
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)
7 views6 pages

Difference Between C and C++ - GeeksforGeeks

The document outlines the key differences between the C and C++ programming languages, highlighting aspects such as exception handling, access modifiers, type checking, and file extensions. C++ supports features like strict type checking and exception handling, which are not present in C. Additionally, C++ allows for named initializers to appear out of order and supports meta-programming through templates.

Uploaded by

amolpatil30990
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/ 6

4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

Aspect C C++

C++ Data Types C++ Input/Output


Exception C++ Arrays C++ Pointers C++ OOPs C++ STL C++ Interview
Direct support for
Exception handling is
Handling exception handling is
supported by C++.
not supported by C.

Access Modifiers C structures don’t have C ++ structures have


access modifiers. access modifiers.

Type Checking Strict type checking in


done in C++. So many
There is no strict type programs that run well in
checking in C C compiler will result in
programming language. many warnings and
errors under C++
compiler.

Type Punning Type punning with


Type punning with
with Unions unions is undefined
unions is allows (C99
behavior (except in very
and later)
specific circumstances)

Named Named initializers must


Named initializers may
Initializers match the data layout of
appear out of order
the struct

Extension File extension is “.cpp” or


File extension is “.c”
“.c++” or “.cc” or “.cxx”

Generic Meta-programming using


Meta-programming
Programming templates (macros are
using macros and
still supported but
_Generic()
discouraged)

https://www.geeksforgeeks.org/difference-between-c-and-c/ 4/9
4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

Difference between C & C++

Comment More info Next Article


Writing First C++ Program - Hello
Campus Training Program World Example

Similar Reads
C++ Programming Language
C++ is a computer programming language developed by Bjarne
Stroustrup as an extension of the C language. It is known for is fast spee…

15+ min read

C++ Basic Syntax


Syntax refers to the rules and regulations for writing statements in a
programming language. They can also be viewed as the grammatical…

15+ min read

Writing First C++ Program - Hello World Example


The "Hello World" program is the first step towards learning any
programming language and is also one of the most straightforward…

14 min read

https://www.geeksforgeeks.org/difference-between-c-and-c/ 5/9
4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

History of C++
The C++ language is an object-oriented programming language & is a
combination of both low-level & high-level language - a Middle-Level…

15+ min read

Features of C++
C++ is a general-purpose programming language that was developed as
an enhancement of the C language to include an object-oriented…

15+ min read

C++ Variables
In C++, variable is a name given to a memory location. It is the basic unit
of storage in a program. The value stored in a variable can be accessed o…

15+ min read

C++ Tutorial | Learn C++ Programming


C++ is a popular programming language that was developed as an
extension of the C programming language to include OOPs programmin…

15+ min read

Object Oriented Programming in C++


Object Oriented Programming - As the name suggests uses objects in
programming. Object-oriented programming aims to implement real-…

15+ min read

Interesting Facts about C++


C++ is a general-purpose, object-oriented programming language. It
supports generic programming and low-level memory manipulation.…

8 min read

Difference Between Structure and Class in C++


In C++, a structure works the same way as a class, except for just two
small differences. The most important of them is hiding implementation…
https://www.geeksforgeeks.org/difference-between-c-and-c/ 6/9
4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

12 min read

Corporate & Communications Address:


A-143, 7th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Pradesh
(201305)

Registered Address:
K 061, Tower K, Gulshan Vivante
Apartment, Sector 137, Noida, Gautam
Buddh Nagar, Uttar Pradesh, 201305

Advertise with us

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal GfG Weekly Contest
Privacy Policy Offline Classroom Program
Careers DSA in JAVA/C++
In Media Master System Design
Contact Us Master CP
GfG Corporate Solution GeeksforGeeks Videos
Placement Training Program

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial

Data Science & ML Web Technologies

https://www.geeksforgeeks.org/difference-between-c-and-c/ 7/9
4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

Data Science With Python HTML


Data Science For Beginner CSS
Machine Learning JavaScript
ML Maths TypeScript
Data Visualisation ReactJS
Pandas NextJS
NumPy NodeJs
NLP Bootstrap
Deep Learning Tailwind CSS

Python Tutorial Computer Science


Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps System Design


Git High Level Design
AWS Low Level Design
Docker UML Diagrams
Kubernetes Interview Guide
Azure Design Patterns
GCP OOAD
DevOps Roadmap System Design Bootcamp
Interview Questions

School Subjects Databases


Mathematics SQL
Physics MYSQL
Chemistry PostgreSQL
Biology PL/SQL
Social Science MongoDB
English Grammar

Preparation Corner More Tutorials


Company-Wise Recruitment Process Software Development
Aptitude Preparation Software Testing
Puzzles Product Management
Company-Wise Preparation Project Management
Linux
Excel
All Cheat Sheets

Machine Learning/Data Science Programming Languages


Complete Machine Learning & Data Science Program - [LIVE] C Programming with Data Structures
C++ Programming Course

https://www.geeksforgeeks.org/difference-between-c-and-c/ 8/9
4/27/25, 7:23 PM Difference between C and C++ | GeeksforGeeks

Data Analytics Training using Excel, SQL, Python & PowerBI - Java Programming Course
[LIVE] Python Full Course
Data Science Training Program - [LIVE]
Data Science Course with IBM Certification

Clouds/Devops GATE 2026


DevOps Engineering GATE CS Rank Booster
AWS Solutions Architect Certification GATE DA Rank Booster
Salesforce Certified Administrator Course GATE CS & IT Course - 2026
GATE DA Course 2026
GATE Rank Predictor

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

https://www.geeksforgeeks.org/difference-between-c-and-c/ 9/9

You might also like