What is the difference between Class and Structure?
Answer Posted / prince rupela
1.Structure is Value Type. Class is a reference type.
2.Structure Contain Data Member. Class Contain Data Member And Member Function.
3.In Structure Data Members are By Default Public. In Class Data Member are By Default Private
4.Structure can not Inherit. Structure can Inherit.
5.There is no Data Hiding Feature in Structure. In Class There is Data Hiding features like Public,Private, Protected.
6.A Structure Can't Abstract . Class can.
7.Structure both use c and c++. class only c++ and oops language.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What character terminates all character array strings a) b) . c) END
What do c++ programmers do?
What is the difference between object-oriented programming and procedural programming?
If you don’t declare a return value, what type of return value is assumed?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
Do the parentheses after the type name make a difference with new?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
Is c++ a low level language?
Is nan a c++?
Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?
What is a set in c++?
Explain queue. How it can be implemented?
Write a program in C++ for Fibonacci series
What is the difference between cin.read() and cin.getline()?
What are the advantages of inheritance in c++?