Difference between Class and Struct.
Answers were Sorted based on User's Feedback
Answer / ravish
Structure is a value type variable, but a class is a
reference type variable.
We can create an object of a class but not for a structure.
Structures does not have function definition but a class has..
| Is This Answer Correct ? | 6 Yes | 7 No |
Answer / farhat khan
In C struct does not use function(method).
| Is This Answer Correct ? | 6 Yes | 10 No |
Answer / naksh @tcs
The major difference between struct and class is :
Struct donot contain functions(methods) as its members.
Yes, by default members of struct are public and that of a
class are private.
| Is This Answer Correct ? | 33 Yes | 79 No |
what are two kinds of java
Where can I get an ansi-compatible lint?
what is data structure.in linear and non linear data structures which one is better?Explain
Why is c called a mid-level programming language?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
which operator is known as dummy operator in c?
What is the advantage of c?
how can f be used for both float and double arguments in printf? Are not they different types?
Why is structure padding done in c?
Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?