The main
basic programming language is C and C++ programming. C language is always most
basic programming language. If you want to learn any programming language so,
you must start with C Programming Language. After C++ Language is preferable.
But do you know what the main difference between C Language and C++ Programming
Language is.
Top
Programming language:
·
C
·
C++
·
Java
·
JavaScript
·
Python
·
R
programming language
·
Go
language
·
PHP
·
MySQL
·
Perl
Programming languages |
What is C?
C Programming language |
The most
basic programming language is C Programming Language C is made first in 1972
and the programming language was developed by Dennis Ritchie at Bells Labs. C
programming language is a procedural programming language that works at lower
language. The program size is very low hence it complied at very lightweight
and it offers manual memory management.
What is C++?
C++ Programming language |
After
learning C programming next important programming language is C++. This language
Designed by Bjarne Stroustrup. C++ programming language is first made its
appearance in 1985. Bjarne started working on the programming language while
working at Bell Labs in 1979. C++ programming language is known as
object-oriented programming language. It also offers you much more features and
functions to the C Programming language. This programming language is providing
development of apps. C++ is also known as the upgraded version of C Language.
C++ Programming language is high level programming language.
Difference
between C and C++
If we are
compared C language and C++ Language, there are so many differences can easily
find. Like Inheritance, classes, objects, constructor, etc. C Programming
language is a structural programming language, and it does not support classes
and objects, while C++ is an object-oriented programming language that supports
the concept of classes and objects. C Programming language is follows the top-down approach means
the execution of program it start with top to bottom, while C++ programming
language is follows the bottom-up approach means the execution of program is
started with bottom to top. One of the major difference is input and output
function. Ex. for printing a sentence in C programming language we use printf()
function but in C++ Programming language we have to use cout() function. Same
in C Programming language scanf() used for input but in C++ Programming
language we use cin() function.
Header files:
For C
Programming language header file is include<stdio.h>.
For C++
Programming language header file is include<iostream.h>.
Classes:
C++ is
object-oriented programming language so, we can create class in program. We can
call the class methods with the help of objects. So, C++ support class in
programs.
But in C
language we cannot create classes and objects. We just create multiple methods
in a program and call it in main function.
Inheritance:
Only C++
Programming language is supported concept of Inheritance. As, we know that C++
is object-oriented programming language. So, if we want to inherit one class to
other class C++ is supports.
But in C
language is only procedure-oriented language. So, it cannot support inheritance
concept.
Constructor:
If the class
name and the method name are same that is known as constructor. And we can
easily use constructor without calling the constructor.
But in C
language it is not allowed to create constructor so we have to create multiple
new methods for a program.
Objects:
In C++
programming language we can create multiple classes and constructor. But for
calling that methods we must define objects for classes. And with the help of
objects we can call every methods of all class.
But in C
programming language no need to create objects because there are no any classes
caring different methods.
The main ()
Function:
In C++ programming
language we cannot call a main() function from any other point. The main()
function is the single execution point.
But in C programming
language, we can have a main() function called by the other functions in the
code.
Variables declaration:
In C++
programming language we can create variables anywhere. There is no any fix
point for declaration variable.
But in C
Programming language we have to declare variables in the starting of programs.
C Programming language |
Structure:
C
programming language and C++ programming language both supports the concept of structure.
Data types:
C++
Programming language supports Boolean and string data types.
C
Programming language we can define user define data types. Also, it supports
built in define data types and primitive data types.
Functions:
C++
Programming language supports functions with different arguments.
C
Programming language not supports function with different arguments. It
supports only functions without any same arguments.
C++ |
Abstractions:
C++
Programming language is supporting the concepts of data abstractions. It helps
user to abstract their programs.
C
Programming language is not supporting the concept of data abstractions.
Encapsulation:
C++
Programming language support the concept of Encapsulation. We can make
different methods like capsule (Combine different methods togethers).
But C
Programming language not support the concept of Encapsulation.
Polymorphism:
Polymorphism
means same name with different arguments (Method overriding and overloading).
This concept is supported in C++ Programming language but not supported in C
Programming language
Function
overloading and overriding:
If two
methods have the same name and in same class but it has different arguments it
is called as function overloading.
If a method
has same name but in different classes these is known as method overriding.
This both
functionalities are supports only in C Programming language not in C
programming language.
Exception Handling:
This concept
is very useful for programmer but this is only supported in C++ Programming
language not in C Programming language.
C vs C++ |
Best reference book for C Programming language:
Best reference book for C++ Programming language:
Let me know in the comment section which is your favorite programming language?
And for more update do subscribe...
0 Comments