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
If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3
What do you mean by translation unit in c++?
What does int * mean in c++?
How can you differentiate between inheritance and implementation in c++?
Do you know what is overriding?
What do you mean by overhead in c++?
How java is different from c and c++?
Why should you learn c++?
What is the difference between a template and a macro?
Can a program run without main?
What is encapsulation in C++? Give an example.
List down the guideline that should be followed while using friend function.
What is a pdb file?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
What are the sizes and ranges of the basic c++ data types?