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 |
please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html
Distinguish between: a) Normal layout & Print Layout views b) Windows Clipboard & office Clipboard c) Save & Save As Commands d) Program File & Data File e) Pie Charts & Barr Charts
how to swap two numbers in a linked list without exchanging the data but only the links?
How is stl different from c++ standard library?
write a program to search and display the position of an element in a single-dimentional array using function.
What is meant by stl in c++?
Write a program in C++ returning starting locations of a substring using pointers
What are stl algorithms?
what is use of for loop?
In what cases using of a 'template' is a better approach then using of a 'base class'?
6 Answers Lucent, Mind Tree, Wipro,
What are the symptoms of stl?
write a piece of c++ code which allocate memory to the 50 object of type CObj