Why do we use “int *p” over “int* p”? | SoloLearn: Learn to code for FREE!

0

Why do we use “int *p” over “int* p”?

Please, describe the method clearly.

12/15/2017 4:07:16 PM

junayeD ●_°

2 Answers

New Answer

+6

Technically, those are the same as compilers ignore whitespace. It is more important when you do something like this: int *p, a[10], c; It helps the person reading it to see the fact that p is a pointer to int, a is an array of 10 int, and c is a regular int.

+2

@john Wells. yes true, and still i would not recommend piling up declarations on the same line like that in the first place:-)