Why is the dereference operator (*) also used to declare a pointer?

前端 未结 6 877
一向
一向 2021-01-30 12:27

I\'m not sure if this is a proper programming question, but it\'s something that has always bothered me, and I wonder if I\'m the only one.

When initially learning C++,

6条回答
  •  醉酒成梦
    2021-01-30 13:31

    Page 65 of Expert C Programming: Deep C Secrets includes the following: And then, there is the C philosophy that the declaration of an object should look like its use.

    Page 216 of The C Programming Language, 2nd edition (aka K&R) includes: A declarator is read as an assertion that when its identifier appears in an expression of the same form as the declarator, it yields an object of the specified type.

    I prefer the way van der Linden puts it.

提交回复
热议问题