What are the differences between a struct and a class in
C++?

Answer Posted / amit patel

Rsn answer is perfect write.Shivani you are wrong.
the visiblity of members default public in structure,
whereas in class its private as all know.
So please don't make myths here.

for the detail answer for explanation read the following link.

http://carcino.gen.nz/tech/cpp/struct_vs_class.php

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between an enumeration and a set of pre-processor # defines?

807


What is a terminating character in c++?

735


What is std :: endl?

568


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

647


What is the use of endl?

525






Who calls main function?

562


Explain the isa and hasa class relationships. How would you implement each?

582


What relational operators if statements in c++?

612


What is meant by entry controlled loop? What all C++ loops are exit controlled?

544


What is the benefit of c++?

575


What do you mean by early binding?

574


What is the difference between while and do while loop? Explain with examples.

571


Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1713


What do the header files usually contains?

603


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

5871