Why do we use ā€œint *pā€ over ā€œint* pā€? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why do we use ā€œint *pā€ over ā€œint* pā€?

Please, describe the method clearly.

15th Dec 2017, 4:07 PM
Bits!
3 Respostas
+ 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.
15th Dec 2017, 4:22 PM
John Wells
John Wells - avatar
+ 3
John Wells thanks šŸ˜
24th Jul 2020, 2:07 AM
Bits!
+ 2
@john Wells. yes true, and still i would not recommend piling up declarations on the same line like that in the first place:-)
15th Dec 2017, 6:52 PM
ifl
ifl - avatar