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 Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
What is purpose of inheritance?
can main method be overloaded...??? How..????
what is the size of an empty class
1. Define a class.
can inline function declare in private part of class?
what is single inheritance?
What is the diamond problem in inheritance?
what is polymorphism?
In the following declaration of main, "int main(int argc, char *argv[])", to what does argv[0] usually correspond? 1) The first argument passed into the program 2) The program name 3) You can't define main like that
Why do we use polymorphism?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)