What is the difference between Class and Structure?

Answer Posted / riyaz

Class Can be abstract but structure can't
Class support inheritance but sturcutre can't
Class allows modifiers such as public,private but structure by default allow public
Class can used for huge amount of data, structure is for limited amount of data

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use using namespace std in c++?

597


What are exceptions c++?

590


Describe the advantage of an external iterator.

614


Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

3051


What is a catch statement?

579






Which of the following is evaluated first: a) && b) || c) !

1799


Is empty stack c++?

519


What is string in c++ programming?

615


Can member functions be private?

591


Differences between private, protected and public and give examples.

577


Is c++ a good beginners programming language?

580


Which is the best c++ compiler for beginners?

554


Differentiate between a pointer and a reference with respect to c++.

695


On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?

676


Can the creation of operator** is allowed to perform the to-the-power-of operations?

578