what is the main difference between c and c++?
Answers were Sorted based on User's Feedback
Answer / raghav ji
the main deference between c and c++ is that c is a
procedural language having no security while c++ is the
object oreanted programing language having more security
power and concepts like
1. bottom up approach
2. classes
3. objects
4. overload
5. inheritens etc...
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / krishnendu dey
1.C doesn't support function overloading but c++ does
2.c++ has a features of NAMESPACE which C doesn't have.
3.In C++ we can use function inside structure whereas C
doesn't permit this.
4 c- function driven
C++- object driven
5. C uses top down approach
C++ uses bottom down aproach
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / g.santhoshini
In c there is a limit for length of identifier should not
preceeded more than 8 characters where as in c++ there is no
limit for length of identifiers.
and in c the file is saved with the extension .c ,in c++ the
file extension is .cpp.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / solaimuthu manikandan
1. C follows the procedural programming paradigm while C++
is a multi-paradigm language(procedural as well as object
oriented)
In case of C, importance is given to the steps or
procedure of the program while C++ focuses on the data
rather than the process.
Also, it is easier to implement/edit the code in case of
C++ for the same reason.
2. In case of C, the data is not secured while the data is
secured(hidden) in C++
This difference is due to specific OOP features like
Data Hiding which are not present in C.
3. C++ supports function overloading while C does not
4. We can use functions inside structures in C++ but not in
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / m.mohanraj
The main difference between c&c++ is the c++ is only advanced version of c.so these two programming language contains some difference only.In the c++ we are using object oriented technique.But in the c the object oriented technique is not there.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sagar dubey
in C++ language we are having the properties of encapsulation,polymorphism,data abstraction and inheritance which is not in the language C..
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sathish kumar
c does not support oops concept like
inheretence,polymorphism,binding.....etc
c++ support oops concept.....
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nizam
c is not powerful language and c++ is powerful language
Is This Answer Correct ? | 0 Yes | 0 No |
What is virtual function?where and when is it used?
what are the realtime excercises in C++?
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
what is the new version of oops
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Child cObj = new Parent() Wahts the output ?
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.
What is polymorphism programming?
What do you mean by binding of data and functions?
What is encapsulation in simple terms?
Whatis the difference between oop and object based language
Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?