What is the Difference between Class and Struct?

Answers were Sorted based on User's Feedback



What is the Difference between Class and Struct?..

Answer / manju

The only difference between class and struct is that

in class all members are private by default whereas in

struct the members are by default public.

Is This Answer Correct ?    11 Yes 0 No

What is the Difference between Class and Struct?..

Answer / ashish srivastava

by default
struct elements are public
while
class elements are private

Is This Answer Correct ?    8 Yes 0 No

What is the Difference between Class and Struct?..

Answer / satvir kaur

STRUCTURE CLASS
1.structure by default is 1. class by default is private
public.
2.structure does not 2.class provide data hiding.
provide data hiding.
3.A structure would be the 3.class would be the collection
collection of related data. of data & code which handels
data.


CAN U TELL ME MORE DIFFERENCE BETWEEN LIKE THIS PLZ TELL ME
AS EARLY AS POSSIBLE I AM WAITING

Is This Answer Correct ?    8 Yes 0 No

What is the Difference between Class and Struct?..

Answer / wfwre

Class elements are accessed using the provided methods.

Is This Answer Correct ?    7 Yes 0 No

What is the Difference between Class and Struct?..

Answer / vishnupriya

1.the variables of struct r jus varialbles inly,whereas it
it objects for class...

2. pointers can be used in structure only for same return
types,but in classes it can be uses for diff classes

Is This Answer Correct ?    2 Yes 0 No

What is the Difference between Class and Struct?..

Answer / purna

answer 3 is wrong.
answer 4 is absolutely corret.

Is This Answer Correct ?    3 Yes 1 No

What is the Difference between Class and Struct?..

Answer / sureshreddy

the diff b/w structure and class is class by deafualt
private, where as structure by default public.

Is This Answer Correct ?    2 Yes 1 No

What is the Difference between Class and Struct?..

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

What is the Difference between Class and Struct?..

Answer / revathy

no functions in structures
member functions are available in class

Is This Answer Correct ?    4 Yes 5 No

What is the Difference between Class and Struct?..

Answer / santhosh.r

Structs allocates continues memory
where as class does not
structs and functions are the basic idea behind class

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

0 Answers   TCS,


how we can make 3d venturing graphics on outer interface

1 Answers   Microsoft,


Explain low-order bytes.

0 Answers  


Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?

5 Answers  


By using C language input a date into it and if it is right?

0 Answers   Aricent,






Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

0 Answers  


code for replace tabs with equivalent number of blanks

0 Answers   Bosch,


Explain how can type-insensitive macros be created?

0 Answers  


What is d scanf?

0 Answers  


What is a stream?

0 Answers  


array of pointer pointer to array pointer to pointer

1 Answers   MAHINDRA,


what is mean by Garbage collection ? Please answer me. Advance thanks.

4 Answers   Excel,


Categories