What is the difference b/w Structure & Class?
Answers were Sorted based on User's Feedback
Answer / srilatha
1.structure contains only data members.
class contains data members and member functions.
2.in structures we can use keyword struct.
in classes we can use keyword class.
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / mohan chaudhari
1.In structure there is no data encapsulation.
but in class, there is data encapsulation.
2.Data member in structure are not private .
In class they are private.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / alekhya
1.in structure we have only data members where as
in class we have members and member functions
2.in class we declare members with access specifiers like
private,public...
in structs we dont have any access specifiers all the
members of structure are pubic
Is This Answer Correct ? | 1 Yes | 0 No |
Which is better between malloc and calloc?
Using which language Test cases are added in .ptu file of RTRT unit testing???
write a program which counts a product of array elements lower than 10.
What is switch in c?
Can I initialize unions?
What is the g value paradox?
how can i calculate mean,median,mode by using c program
write a function which accept two numbers from main() and interchange them using pointers?
What is a Genralised LInked List?? Please give a detailed explation of it..
char *p="name"; printf(p);
what is difference between declaring the pointer as int and char in c language?
Why is c known as a mother language?