What is the difference between C and C++ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What is the difference between C and C++

I need exact answers plsšŸ‘

8th Nov 2016, 12:58 PM
Raj Krishna R K
Raj Krishna R K - avatar
5 Respostas
+ 2
A few differences: 1 C is a procedural (aka structural) programming language. In addition to begin procedural, C++ is also an object oriented programming language. 2 In C language, the solution is achieved through a sequence of procedures or steps. Therefore, C is a function driven language. C++ can model the whole solution in terms of objects and that makes the solution better organized. C++ is an object driven language. 3 Concept of virtual functions is not present in C. C++ offers the facility of using virtual functions.Ā  4 Operator overloading is not possible in C. C++ allowsoperator overloading.Ā  5 Data in C functions is not secured. Data can be easily accessed by other external functions.All the data in C++ can be put inside objects. This provides better data security. 6 C is aĀ middle level language.C++ is aĀ high level language. 7 C programs are divided intomodules and procedures.C++ programs are divided intoclasses and functions. 8 C programs use top-down approach.C++ programs use bottom-up approach.Ā  9 In C, theĀ main() functionĀ can be called from other functions.In C++, theĀ main()functionĀ can not be called from other functions. The program execution begins fromĀ main()function. 10 C language does not provide the feature of namespace. Namespaces are available in C++.
8th Nov 2016, 3:50 PM
Aneeshan
Aneeshan - avatar
+ 2
the other few : 11 Exception handling is not easy in C. It has to be done by using other functions.C++ provides exception handling through Try and Catch block. 12 Inheritance is not possible in C.Because C++ is an object oriented language, inheritance is possible. 13 In C, all the variables must be declared at the beginning of a scope.C++ allows declaring variables anywhere within the scope. This allows us to declare a variable when we use it for the first time.Ā  14 In C, function overloading is not possible. Function overloading is to use two functions with the same name within a scope.Function overloadingĀ is possible in C++Ā  15 Standard Input in C is received throughĀ scanf()function whereas standard output is given throughprintf()Ā function. C++ usesĀ cin>>andĀ cout>>Ā as standard input and output functions respectively. 16 C programs are saved in files with extensionĀ .c C++ programs are saved in files with extensionĀ .cpp 17 Mapping between data and functions is difficult in C. In C++ data and functions are easily mapped through objects.Ā  18 In C, polymorphismĀ is not possible.Being a fully object oriented language, C++ offers polymorphism.Ā  19 C supports only built-in data types. C++ supports both built-in and user-defined data types.
8th Nov 2016, 3:51 PM
Aneeshan
Aneeshan - avatar
+ 1
"++"
8th Nov 2016, 1:08 PM
MaxInertia
MaxInertia - avatar
+ 1
šŸ˜ŽšŸ˜ŽšŸ˜ŽšŸ˜ŽšŸ˜ŽšŸ˜ŽšŸ“
8th Nov 2016, 1:10 PM
Raj Krishna R K
Raj Krishna R K - avatar
+ 1
ohhhh
8th Nov 2016, 1:10 PM
Raj Krishna R K
Raj Krishna R K - avatar