How can a struct in c++ differs from a struct in c?



How can a struct in c++ differs from a struct in c?..

Answer / Shivam Sundaram

In C++, structs have public member access by default, whereas in C, they have private access. Additionally, C++ allows for inheritance and operator overloading with structures.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Please explain the reference variable in c++?

1 Answers  


What is the type of 'this' pointer?

1 Answers  


Explain some examples of operator overloading?

1 Answers  


Can we change the basic meaning of an operator in c++?

1 Answers  


Do class method definitions?

1 Answers  


Differentiate between late binding and early binding. What are the advantages of early binding?

1 Answers  


Why are pointers used?

1 Answers  


Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1

4 Answers   Quark,


Where can I run c++ program?

1 Answers  


How can we read/write Structures from/to data files?

1 Answers  


Write a c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?

0 Answers   Maxobiz,


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1 Answers  


Categories