C++ Programmer Question:

Download Job Interview Questions and Answers PDF

Please explain is there a difference between class and struct?

C++ Programmer Interview Question
C++ Programmer Interview Question

Answer:

The only difference between a class and struct are the access modifiers. Struct members are public by default; class members are private. It is good practice to use classes when you need an object that has methods and structs when you have a simple data object.

Download C++ Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me what will the line of code below print out and why?Explain what are VTABLE and VPTR?