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
which of the following is not an secondary constant a) array b) real c) union
Describe the advantages of operator overloading?
How do I run a program in notepad ++?
What is polymorphism in c++? Explain with an example?
Define a conversion constructor?
Differentiate between structure and class in c++.
What is the use of typedef?
Tell me difference between constant pointer and pointer to a constant.
What flag means?
What is a c++ vector?
When can I use a forward declaration?
What are multiple inheritances (virtual inheritance)?
What is abstraction in c++ with example?
How much do c++ programmers make?
What do you know about near, far and huge pointer?