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
Is map sorted c++?
Explain rtti.
Explain the difference between c & c++?
What flag means?
How do you remove an element from a set in c++?
What is c++ course?
How can virtual functions in c++ be implemented?
What is setw manipulator in c++?
What is c++ map?
What are virtual constructors/destructors?
How does atoi function work?
What is the best free c++ compiler for windows?
How do you find out if a linked-list has an end?
Can you pass a vector to a function?
Can the creation of operator** is allowed to perform the to-the-power-of operations?