What are the differences between a struct and a class in
C++?
Answer Posted / amit patel
Rsn answer is perfect write.Shivani you are wrong.
the visiblity of members default public in structure,
whereas in class its private as all know.
So please don't make myths here.
for the detail answer for explanation read the following link.
http://carcino.gen.nz/tech/cpp/struct_vs_class.php
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
describe private access specifiers?
Define copy constructor.
Can you please explain the difference between static and dynamic binding of functions?
Explain the use of vtable.
What is the difference between c++ and turbo c++?
Give 10 points of differences between C & C++.
Why do we use using namespace std in c++?
Define a nested class. Explain how it can be useful.
How to declare a function pointer?
What do you mean by vtable and vptr in c++?
What is data abstraction? How is it different from data encapsulation?
Why are pointers not used in c++?
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What is the difference between #define debug 0 and #undef debug?
Does c++ have foreach?