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


Please Help Members By Posting Answers For Below Questions

what are function pointers?

663


How do I download c++?

651


What is atoi in c++?

663


Why is main an int?

619


What are multiple inheritances (virtual inheritance)?

675






What is endl?

722


What are the advantages of using friend classes?

721


Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.

903


What is a flag in c++?

710


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

1930


What is the best c++ book?

800


What is std namespace in c++?

805


What is the best book for c++ beginners?

666


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.

2569


Can a program run without main?

735