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

Answers were Sorted based on User's Feedback



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

Answer / pradeepramagiri

class members have the privite access by default where as
structure members have the public access by default

Is This Answer Correct ?    34 Yes 2 No

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

Answer / murali

A class is inhertied to onther class but structure we
cannot inhertied

Is This Answer Correct ?    18 Yes 8 No

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

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

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

Answer / navneet kaur

c is a procedure oriented language but c++ is a object
oriented language.

Is This Answer Correct ?    6 Yes 3 No

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

Answer / vijayendra singh chand

The main difference between class and structure is that
class is reference type whereas structure is value type.

Is This Answer Correct ?    5 Yes 4 No

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

Answer / naveen tuteja

A structure can't contain the static ans constant variable
but a class can contain both.

Is This Answer Correct ?    4 Yes 4 No

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

Answer / naveen tuteja

We can declare a structure without a name tag but we cannot
declare a class without name tag.

Is This Answer Correct ?    4 Yes 4 No

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

Answer / renuka

IN CLASS WE USE BOTH VARIABLE AND FUNCTION OR IN STRUCTURE WE USE VARIABLE ONLY....

Is This Answer Correct ?    3 Yes 3 No

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

Answer / kanak shah

there is vast differece between class and structure in c++
in my view class is class room and structure mean class
room structure.

Is This Answer Correct ?    3 Yes 28 No

Post New Answer

More OOPS Interview Questions

Why do we use encapsulation in oops?

0 Answers  


How compiler selects(internally) required overridden function in inheritance?

2 Answers   CSC, Infinite Computer Solutions,


write a program to print * * * * * *

2 Answers  


What is polymorphism? Explain with an example.

48 Answers  


What is an interface in oop?

0 Answers  






Define a class to represent a bank account. Include the following members: Data Members: Name of the Depositor Account Number Type of Account Balance amount in the account Member Functions: To assign the initial values. To deposit an account. To withdraw an amount after checking the balance. Write a C++ main program to display account number, name and balance.

6 Answers  


//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  


We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?

8 Answers   IBM, Sage, Vertex,


Have you ever interfaced with a database?

2 Answers   IBM,


#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; wow *b; a.x = 22; b = &a; a.x = 23; cout << b->x; return 0; }

1 Answers  


what is static?

4 Answers  


What is a friend function & its advantage?

2 Answers   TCS,


Categories