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 polymorphism what is it for and how is it used?
This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
what are the different types of qualifier in java?
What is an interface in oop?
Can destructor be overloaded?
What exactly is polymorphism?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is difference between pop and oop?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
c++ program to swap the objects of two different classes
What are the types of abstraction?
What is difference between oop and pop?
hi all..i want to know oops concepts clearly can any1 explain??
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?