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 function pointers?
How do I download c++?
What is atoi in c++?
Why is main an int?
What are multiple inheritances (virtual inheritance)?
What is endl?
What are the advantages of using friend classes?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is a flag in c++?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
What is the best c++ book?
What is std namespace in c++?
What is the best book for c++ beginners?
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
Can a program run without main?