What is the difference between const int *ptr and int const
*ptr???
Answers were Sorted based on User's Feedback
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 |
Answer / abdul sami
'const int* ptr' means the value whose address is being
held by ptr is constant and cant be changed while
'int const *ptr' means the pointer cant be changed like it
cant be incremented or decremented although you can change
the date pointed to by ptr.
Is This Answer Correct ? | 41 Yes | 57 No |
What is polymorphism give a real life example?
What are classes oop?
What is R T T I ?
Define a class to represent a bank account. Include the following members: Data Members: Name of the Depositor Account Number Type of Account Balance amount in the account Member Functions: To assign the initial values. To deposit an account. To withdraw an amount after checking the balance. Write a C++ main program to display account number, name and balance.
why reinterpret cast is considered dangerous?
What is class and object in oops?
Do you know about multiple inheritance?
when to use 'mutable' keyword and when to use 'const cast' in c++
WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE
What is encapsulation c#?
Pls...could any one tell me that whether we can access the public data memeber of a class from another class with in the same program. Awaiting for your response Thanku
why to use template classes in c++?