What are the differences between a struct and a class in
C++?
Answer Posted / rsn
Hello Shivani,
I think both struct and class in C++ are quite the same
except for the fact that, members in struct are public by
default whereas they are private for class.
Moreover struct also supports inheritance,polymorphism
etc...etc...
| Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
What are the three forms of cin.get() and what are their differences?
What is object in c++ wikipedia?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What is abstraction with real time example?
Explain the static member function.
What do you understand by pure virtual function? Write about its use?
How to declare an array of pointers to integer?
Why is c++ awesome?
what are Access specifiers in C++ class? What are the types?
What are the steps in the development cycle?
What is the difference between global variables and static varables?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
How do I run a program in notepad ++?
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.
When does the c++ compiler create temporary variables?