What is the difference between const int *ptr and int const
*ptr???
Answer Posted / manjunath
a) const int *ptr and
b) int const *ptr
Both actually mean the same...
Read from Right to left:
for(a):-> ptr is a pointer to an integer Constant and
for(b):-> ptr is a pointer to a constant integer...
..............
int *const ptr----------> ptr is a constant pointer to an
integer...
| Is This Answer Correct ? | 95 Yes | 26 No |
Post New Answer View All Answers
What is inheritance write a program to show use of inheritance?
What are classes oop?
What is property in oops?
What is object and example?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What are functions in oop?
Which method cannot be overridden?
Why is static class not inherited?
What are different oops concepts?
How is class defined?
What is object in oop?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
How do you answer polymorphism?
Can you explain polymorphism?
Why do we need oop?