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 is the purpose of scanf() and printf() functions?

723


Write a code to generate divisors of an integer?

642


How can you read a directory in a C program?

651


What are the advantages of Macro over function?

1201


What is the purpose of realloc()?

672






What is a good way to implement complex numbers in c?

594


What is sorting in c plus plus?

565


How is actual parameter different from the formal parameter?

591


What is the size of a union variable?

598


What are the properties of union in c?

590


What is a example of a variable?

553


can anyone please tell about the nested interrupts?

1678


What are conditional operators in C?

627


Explain what is the use of a semicolon (;) at the end of every program statement?

735


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1783