What is the difference between Class and Structure?
Answer Posted / navin
Structure: Initially (in C) a structure was used to bundle
different type of data types together to perform a
particular functionality. But C++ extended the structure to
contain functions also. The major difference is that all
declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all
the members inside the class are private.
| Is This Answer Correct ? | 182 Yes | 55 No |
Post New Answer View All Answers
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
Differentiate between the manipulator and setf( ) function?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
daily Routine of father
What is the difference between multiple and multilevel inheritance in c++?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
How can I disable the "echo" feature?
What are the rules about using an underscore in a c++ identifier?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
What does int * mean 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.
When is the copy constructor called?
How can you quickly find the number of elements stored in a dynamic array?
What is setfill c++?
What are default parameters? How are they evaluated in c++ function?