What is the difference b/w Structure & Class?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c language & why it is used?

583


Explain bit masking in c?

639


What are formal parameters?

662


What are identifiers and keywords in c?

574


What is getch () for?

680






To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2191


What are extern variables in c?

550


What is the Purpose of 'extern' keyword in a function declaration?

655


Explain how do you list files in a directory?

619


How can I determine whether a machines byte order is big-endian or little-endian?

622


Explain continue keyword in c

589


What is clrscr ()?

639


What is the value of uninitialized variable in c?

577


What is hashing in c language?

616


What is const keyword in c?

752