what is the difference between class and structure in C++?

Answer Posted / balaram singh

1->CLASS IS THE ADT WHERE AS STRUCTURE IS UDT
2->CLASS NEEDS ACCESS SPECIFIER SUCH AS PRIVATE,PUBLIC &
PRIVATE WHERE AS STRUCTURE MEMBERS CAN BE ACCESSED BY
PUBLIC BY DEFAULT & DO'NT NEED ANY ACCESIFIERS.
3->CLAAS IS OOPS WHERE STRUCTURE IS BORROWED FROM
TRADITIONAL STRUCTURED(POP) CONCEPT

Is This Answer Correct ?    13 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by abstraction?

605


What is difference between class and object with example?

560


What is polymorphism in oop example?

511


What is the significance of classes in oop?

585


Who invented oop?

647






#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2058


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2027


What is destructor give example?

595


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1650


Can enum be null?

581


What is the full form of oops?

605


What is the benefit of oop?

566


What is stream in oop?

835


Why do while loop is used?

570


What is abstraction oop?

618