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
How to allocate memory dynamically for a reference?
What is meant by forward referencing and when should it be used?
How can you link a c program with a c function?
How do we balance an AVL Tree in C++?
Can we change the basic meaning of an operator in c++?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
Does a derived class inherit or doesn't inherit?
What are enumerations?
In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that
What is class in c++ with example?
What are 2 ways of exporting a function from a dll?
List the special characteristics of constructor.
Can member functions be private?
What is c++ & why it is used?