Difference between Class and Struct.

Answer Posted / ajay prajapat

1. Structure is value type where is class is refrance
type.So class data is store in heap where as stuct data are
store in stack.

2. default type of function in struct is public where as
private in class

Is This Answer Correct ?    55 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many parameters should a function have?

873


What is malloc() function?

831


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1011


What is meant by inheritance?

843


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

998


Why does the call char scanf work?

876


What are the two forms of #include directive?

864


What is the difference between functions getch() and getche()?

826


What is "Duff's Device"?

901


What is the correct declaration of main?

906


what is the format specifier for printing a pointer value?

788


Explain Basic concepts of C language?

826


Is null always equal to 0(zero)?

793


write a c program to calculate sum of digits till it reduces to a single digit using recursion

2987


What is the benefit of using const for declaring constants?

810