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 are iterators in c++?
What is the use of ::(scope resolution operator)?
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
How does list r; differs from list r();? How did c++ get its name? Discussion on error handling of C++ . Explain method of creating object in C++ ? If a function doesn’t return a value, how do you declare the function? Can user-defined object be declared as static data member of another class? What is the difference between mutex and binary semaphore? What are exceptions c++? What is unary operator? List out the different operators involved in the unary operator. What is a rooted hierarchy? If I is an integer variable, which is faster ++i or i++? Can there be at least some solution to determine the number of arguments passed to a variable argument list function?