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

Answer Posted / ramesh kasi

The only difference is related to the default access
specifier.
The members of a structure have public access by default.
The members of a calss have private access by default.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the use of void main() in C++ language?

634


How long it will take to learn c++?

606


Is oops and c++ same?

570


What kind of jobs can I get with c++?

589


What is c++ 11 and c++ 14?

574






What is oop in c++?

591


What are the benefits of c++?

562


what are the iterator and generic algorithms.

1452


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

545


Explain stack & heap objects?

621


What are formatting flags in ios class?

601


Why is c++ still used?

593


which of the following is not an secondary constant a) array b) real c) union

1246


Write a Program for find and replace a character in a string.

544


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == ) y-= 7; else y = 8; if the value of x is 4 before the nested IFs are executed, what is the value of y after the nested IFs are executed?

1574