Difference between Structure and Class in C++?
Answers were Sorted based on User's Feedback
Answer / ashish raghuvanshi
Basically in C++ structure and class are same but with some
minor diffrences listed below:-
1. In classes all the members by default are private but in
structure members are public by default.
2. There is no term like constructor and destructor for
structs, but for class compiler creates default if you
don't provide.
| Is This Answer Correct ? | 79 Yes | 14 No |
Answer / madhusudhan
1. In classes all the members by default are private but in
structure members are public by default.
2. There is no term like constructor and destructor for
structs, but for class compiler creates default if you
don't provide.
3. Sizeof empty structure is 0 Bytes wer as Sizeof empty
class is 1 Byte
| Is This Answer Correct ? | 24 Yes | 20 No |
Answer / ammukutty
give the clear full difference between structure and class
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / alok
no. we can use the concept of constructor and destruct in c++ structure. one difference is that in c structure and c++ class is structure automatically initialization with zero.
| Is This Answer Correct ? | 2 Yes | 8 No |
write a piece of c++ code which allocate memory to the 50 object of type CObj
write a program that input four digit no and finds it is palindrome or not
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
wap in c++ which accept a integer array and its size as argument and replaces element having even values with its half and element having odd values with twice its value
What is the Difference between CArray and CList?
1 Answers ProdEx Technologies, Siemens,
How do you convert stl to steps?
Explain when u will use Observer pattern and how u will implement in c++ .
Who created stl?
Give the output of the following program main() {int ret; ret=fork();ret=fork();ret=fork();ret=fork(); if(!ret) printf("sun"); else printf("solaris");
what is the acronym of the term 'C.O.M.P.U.T.E.R' ?
17 Answers Config Systems, Google, Wipro,
i want a road rash 3d game code if some one know please help me
how to get the sum of two integers?