What is the difference between Class and Structure?

Answer Posted / riyaz

Class Can be abstract but structure can't
Class support inheritance but sturcutre can't
Class allows modifiers such as public,private but structure by default allow public
Class can used for huge amount of data, structure is for limited amount of data

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you differentiate between inheritance and implementation in c++?

649


What is difference between c++ 11 and c++ 14?

586


How to demonstrate the use of a variable?

646


How should runtime errors be handled in c++?

617


What is the difference between global int and static int declaration?

416






Is c++ a high level language?

560


If a function doesn’t return a value, how do you declare the function?

622


Explain container class.

695


What is increment operator in c++?

566


Can member data be public?

603


What are default parameters? How are they evaluated in c++ function?

675


What is the benefit of learning c++?

557


How to access a variable of the structure?

588


What should main() return in c and c++?

532


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

1017