What is the difference between Class and Structure?

Answer Posted / deepica

in classes we can declare variables and functions while in structure we can have only functions.In classes we have ACCESS SPECIFIER,while in structures we dont have any.Ic classes no Keyword is used ,while in Structures STRUCT keyword is used.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is input operator in c++?

587


Can non graphic characters be used and processed in C++?

702


Is c++ the most powerful language?

562


What is the difference between reference and pointer?

610


Why do we need templates?

540






what are the types of Member Functions?

609


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

637


What is a namespace in c++?

596


How many static variables are created if you put one static member into a template class definition?

567


what are function pointers?

578


What is the array and initializing arrays in c++?

506


How is computer programming useful in real life?

596


What is the use of volatile variable?

599


What is the use of this pointer in c++?

568


Is std :: string immutable?

559