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

Answer Posted / reejusri

There is no diffrence between int* x and int *x.
but difference will come into picture when you use:

Case 1:
int* x,y,z;

and

Case2:
int *x,y,z;

in first case x,y and z are integer pointer, where as
un second case only x is integer pointer rest y and z is
integer. So its always a good practice not to put multiple
variable in single line.

Is This Answer Correct ?    4 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the meaning of c++?

636


What can I safely assume about the initial values of variables which are not explicitly initialized?

713


Describe the process of creation and destruction of a derived class object?

739


What is basic if statement syntax?

646


What are pointer-to-members? Explain.

716






Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?

1831


What is #include iostream?

852


What is & in c++ function?

676


If all is successful, what should main return a) 0 b) 1 c) void

655


What is tellg () in c++?

833


Can we define function inside main in c++?

649


Why c++ is created?

654


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

651


What do you mean by delegate? Can a user retain delegates?

603


What is the c++ programming language used for?

665