Difference between Class and Struct.

Answer Posted / praveena.g

class ex:-
class classname
{
int a;
float b;
}
struct {
int a;
int b;
}struct name;

in the struct all members are by default public,
in the class we can deference it private,public,protected.
like these we class will taken.

Is This Answer Correct ?    62 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does c value mean?

843


What does sizeof return c?

792


What is #define size in c?

841


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

780


Explain what does a function declared as pascal do differently?

896


What does the message "automatic aggregate intialization is an ansi feature" mean?

910


What is #define in c?

808


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

1210


Can a pointer point to null?

780


Why we use void main in c?

813


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1780


Mention four important string handling functions in c languages .

833


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

857


Explain how can I convert a number to a string?

843


What is the difference between volatile and const volatile?

741