Difference between Structure and Class in C++?

Answer Posted / ashish raghuvanshi

Basically in C++ structure and class are same but with some
minor diffrences listed below:-
1. In classes all the members by default are private but in
structure members are public by default.
2. There is no term like constructor and destructor for
structs, but for class compiler creates default if you
don't provide.

Is This Answer Correct ?    79 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a list in c++ stl?

781


What is stl stand for?

811


What is the stl, standard template library?

675


how to use C++?

2154


What does stl stand for in basketball?

725






write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

2595


Why should a c++ programmer be interested in stl?

723


Explain stl.

982


Is stl open source?

719


What are the various types of stl containers?

829


What is stl language?

750


What are stl algorithms?

710


What is stl stack?

745


Can we use stl in coding interviews?

1389


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 total number of disk writes by MySQL.

2067