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
Why do we need constructors in c++?
What are the advantages of using a pointer?
What is c++ library?
What are shallow and deep copy?
How are pointers type-cast?
Why c++ is created?
Define what is constructor?
Define pre-condition and post-condition to a member function in c++?
What is the difference between global variables and static varables?
What language is a dll written in?
Should I learn c or c++ first?
What is the main purpose of overloading operators?
What is setf in c++?
What is c++ array?
Why null pointer is used?