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

If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3

1095


What do you mean by translation unit in c++?

976


What does int * mean in c++?

967


How can you differentiate between inheritance and implementation in c++?

925


Do you know what is overriding?

816


What do you mean by overhead in c++?

815


How java is different from c and c++?

938


Why should you learn c++?

807


What is the difference between a template and a macro?

816


Can a program run without main?

898


What is encapsulation in C++? Give an example.

835


List down the guideline that should be followed while using friend function.

825


What is a pdb file?

756


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1050


What are the sizes and ranges of the basic c++ data types?

812