Is there any difference between dlearations int* x and int
*x? If so tell me the difference?
Answer Posted / foo
The difference is that in the first case the space is after
the * and in the second case the space is before.
Functionally there is no difference.
Arguably int* x is slightly worse since (as other answers
demonstrate) people can misinterpret "int* i, j" as
declaring two pointers-to-int where "int *i, j" is perhaps a
bit clearer.
Practically, you should adopt whatever style is required by
wherever you work or whomever you work with.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How static variables and local variablesare similar and dissimilar?
What is the advantage of an external iterator.
Which software is best for programming?
What do you mean by persistent and non persistent objects?
Is it possible to provide special behavior for one instance of a template but not for other instances?
What is setiosflags c++?
Which coding certification is best?
Write about c++ storage classes?
Explain what you mean by a pointer.
What are the advantages of inheritance in c++?
What does std :: flush do?
What is a c++ map?
Which of the following is evaluated first: a) && b) || c) !
Define a conversion constructor?
How does list r; differs from list r();?