Difference between Class and Struct.

Answer Posted / swetcha

The only difference between a struct and a class is in the
default access. By default, all the members of a struct are
public whereas in a class, al the members are private. The
same is true for the default inheritance type: a struct
entails public inheritance by default whereas a class
entails private inheritance.

Is This Answer Correct ?    98 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

738


Why c is called procedure oriented language?

575


How can you restore a redirected standard stream?

606


What is typedef example?

611


Subtract Two Number Without Using Subtraction Operator

348






Write a program to reverse a string.

631


What is pointer in c?

731


which is an algorithm for sorting in a growing Lexicographic order

1394


Is c compiled or interpreted?

659


Why string is used in c?

574


What happens if you free a pointer twice?

601


Which is best book for data structures in c?

590


Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2642


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1109


Compare and contrast compilers from interpreters.

678