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
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
How the programmer of a class should decide whether to declare member function or a friend function?
Why struct is used in c++?
What are all predefined data types in c++?
Write a Program to find the largest of 4 no using macros.
Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL
Why can templates only be implemented in the header file?
What are virtual constructors/destructors?
What you know about structures in C++?
What character terminates all character array strings a) b) . c) END
Explain the uses of static class data?
There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.
Specify different types of decision control statements?
What is an adaptor class in c++?
What is prototype for that c string function?