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
What is the purpose of template?
What are c++ variables?
What does new do in c++?
What is difference between class and function?
What does count ++ do in c++?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Is c++ a programming language?
What is size_type?
When is the copy constructor called?
What are the extraction and insertion operators in c++?
What is a dynamic binding in c++?
Can we delete this pointer in c++?
Can a program run without main in c++?
Explain the isa and hasa class relationships. How would you implement each?
How the virtual functions maintain the call up?