What is the difference between Class and Structure?
Answer Posted / navin
Structure: Initially (in C) a structure was used to bundle
different type of data types together to perform a
particular functionality. But C++ extended the structure to
contain functions also. The major difference is that all
declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all
the members inside the class are private.
Is This Answer Correct ? | 182 Yes | 55 No |
Post New Answer View All Answers
What is stream and its types in c++?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
How can we access protected and private members of a class?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
What are the various compound assignment operators in c++?
Explain what is polymorphism in c++?
What is format for defining a structure?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
What are arithmetic operators?
Why c++ does not have finally?
Write about the access privileges in c++ and also mention about its default access level?
What is the standard template library (stl)?
What is an accessor in c++?
Differences between private, protected and public and give examples.
Explain static and dynamic memory allocation with an example each.