Difference between Class and Struct.

Answers were Sorted based on User's Feedback



Difference between Class and Struct. ..

Answer / ravish

Structure is a value type variable, but a class is a
reference type variable.
We can create an object of a class but not for a structure.
Structures does not have function definition but a class has..

Is This Answer Correct ?    6 Yes 7 No

Difference between Class and Struct. ..

Answer / farhat khan

In C struct does not use function(method).

Is This Answer Correct ?    6 Yes 10 No

Difference between Class and Struct. ..

Answer / naksh @tcs

The major difference between struct and class is :
Struct donot contain functions(methods) as its members.

Yes, by default members of struct are public and that of a
class are private.

Is This Answer Correct ?    33 Yes 79 No

Post New Answer

More C Interview Questions

What are the valid places to have keyword “break”?

0 Answers  


i want to know aptitude questions,technical questions

2 Answers  


The program to allow the characters from the input received and send this function to a function check if the characters between letters a to z is a function of y joins as the characters main and output to otherwise return to the original function of the y characters

0 Answers  


how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .

1 Answers  


What is the difference between mpi and openmp?

0 Answers  


What is %d used for?

0 Answers  


If the static variable is declared as global, will it be same as extern?

1 Answers   Samsung,


ratio,age,persentage

0 Answers  


What happens if you free a pointer twice?

0 Answers  


What is malloc return c?

0 Answers  


c pgm count no of lines , blanks, tabs in a para(File concept)

2 Answers  


What is a newline escape sequence?

0 Answers  


Categories