what is the main difference between c and c++?

Answer Posted / saraswathi

Difference between c and C++

C C++

1. C is a procedure oriented programming C++ is a object
oriented programming

2. C uses #include<stdio.h> C++ uses #include<iostream.h>

3. In C main focus is on functions In C++ main focus is on
data rather than functions. Data is not freely moved around
the system rather the functions exists in the object are the
only means by which the data can be accessed

4. In C No Data security In C++ data is hidden and is
secure from unauthorised access

5. In C there is no concepts like encapsulation,
polymorphism , inheritance etc. C++ provide encapsulation,
polymorphism, inheritance etc.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1604


What is the highest level of cohesion?

757


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

936


what is difference between class template and template class?

2382


Why multiple inheritance is not allowed?

788


What is encapsulation with real life example?

773


What does sksksk mean in text slang?

1814


What is super in oop?

814


when to use 'mutable' keyword and when to use 'const cast' in c++

1873


What is encapsulation and abstraction? How are they implemented in C++?

834


What is the diamond problem in inheritance?

801


What is abstraction in oops with example?

980


What is encapsulation in oop?

774


Why is oop better than procedural?

796


What is interface in oop?

866