What is the difference between Class and Structure?
Answer Posted / anshu sharma
Structure are value types and classes are reference types.So
structures use stack and classes use heap.
Structures members can not be declared as protected , but
class members can be.
You can not do inheritance in structures.
Structures do not require constructors while classes require
| Is This Answer Correct ? | 158 Yes | 54 No |
Post New Answer View All Answers
What is runtime polymorphism in c++?
Why is it necessary to use a reference in the argument to the copy constructor?
What is c strings syntax?
What is pointer to member?
What is string in c++ programming?
What are the differences between malloc() and calloc()?
List the advantages of inheritance.
Where are setjmp and longjmp used in c++?
List different attributes in C++?
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
Do the parentheses after the type name make a difference with new?
When to use “const” reference arguments in a function?
Please explain class & object in c++?
What is setfill c++?
Explain the difference between c++ and java.