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's the full form of STL?
How can you overcome the diamond problem in inheritance?
Is enum a class?
write a program that takes input in digits and display the result in words from 1 to 1000
when to use 'mutable' keyword and when to use 'const cast' in c++
How to execute business logic for only once ..?even though user clicks submit button multiple times by mistake..? (i disabled JavaScript)
i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????
What is difference between #define and const?
How to improve object oriented design skills?
Can we create object of abstract class?
write a c++ program to find maximum of two numbers using inline functions.
how to swap the variables without using temp and operators