What is the Difference between Class and Struct?

Answer Posted / talib hassan

1.Structure cannot provide the re usability but class provide the re usability of code.
2. All the members of structure are public but a class provide the several types of accessing methods.
3. structure cannot support polymorphism concept but class provide polymorphism.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does *p++ do? What does it point to?

612


What does malloc () calloc () realloc () free () do?

556


What is storage class?

654


What is calloc in c?

656


What is pass by reference in c?

606






Can you define which header file to include at compile time?

584


In C programming, how do you insert quote characters (‘ and “) into the output screen?

890


how to construct a simulator keeping the logical boolean gates in c

1722


Is fortran still used in 2018?

589


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

734


we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?

802


What is the heap in c?

637


what is a constant pointer in C

674


What are the advantages of union?

624


Which is better oop or procedural?

628