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

Answer Posted / raman sharma

in c is structual language and c++ is a object oriented
language. in c we use #include<stdio.h> and in c++ we use
#include<iostream.h>. in c we single line comment /* /* and
in c++ we use // //. in c we use manipulator and in c++ we
dont use manipulator because in c++ there is a one header
file we use #include<iomanip.h>. in c++ there is
class,object,encapsulation,inheritance,message
binding,polymorphism etc and in c there is no class and
object. in c++ we use endl in line break also \n but in c
programming there is only \n we use. there is constructor
and disgustor. in c++ is easy and less complexity program.
in c there is use printf() for output and scanf()for input
and c++ there is cout<< for output and cin>> for input and
<< is insertion and >> is a extraction this is main
differece between in c and c++

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an example of genetic polymorphism?

657


Explain virtual inheritance?

688


How do you use inheritance in unity?

595


What is overloading and its types?

624


What exactly is polymorphism?

614






Explain the advantages of inheritance.

680


What is encapsulation in ict?

610


What is a superclass in oop?

675


Advantage and disadvantage of routing in telecom sector

790


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.

709


What does it mean when someone says I oop?

591


Write a c++ program to display pass and fail for three student using static member function

2821


Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation

1666


What are main features of oop?

644


What is inheritance write a program to show use of inheritance?

620