What is the difference between class and structure?

Answer Posted / konankiswetha

class is a slow access because of heap memory. But struct
is a faster in access because of stack memory.



values are initialize at the time of declaration in class
but not in struct.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static in oop?

585


What is inheritance in simple words?

622


How is polymorphism achieved?

580


What is a function in oop?

626


What are the 3 principles of oop?

612






What does and I oop and sksksk mean?

648


What is for loop and its syntax?

592


What are the benefits of polymorphism?

616


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

624


What is the oops and benefits of oops programming?

549


Can we override main method?

597


What is difference between inheritance and polymorphism?

561


What is encapsulation and abstraction? How are they implemented in C++?

629


What do you mean by abstraction?

605


What is multilevel inheritance in oop?

552