Is there any difference between dlearations int* x and int
*x? If so tell me the difference?

Answer Posted / prasant

Reejusri is correct....
VC++ compiler complains with error
"error C2440: '=' : cannot convert from 'int' to 'int *'
1> Conversion from integral type to pointer type
requires reinterpret_cast, C-style cast or function-style
cas" for the following code

int *x,y,z;
x=y;

So, there is a difference.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use pointers in c++?

679


Describe delete operator?

707


Explain what are mutator methods in c++?

671


What gives the current position of the put pointer?

641


Is c++ primer good for beginners?

674






Which c++ operator cannot overload?

641


What is the use of 'using' declaration in c++?

719


What is the this pointer?

717


Why is null pointer used?

783


Which is the best c++ compiler for beginners?

651


What is data hiding c++?

685


What is encapsulation in C++? Give an example.

682


Is c++ a programming language?

680


Define a constructor - what it is and how it might be called (2 methods)?

695


What is this weird colon-member (" : ") syntax in the constructor?

626