可能重复:
Declaring pointers; asterisk on the left or right of the space between the type and name?
Does it matter where I place the asterisk when declaring pointers in C++?为什么人们使用Type * var而不是Type * var?
我搜索,但我的关键字似乎并不适合。我很确定这个问题已经被问到了,所以如果你知道链接或者其他东西的话,请指出一些方向。
我的问题是,为什么这么多的人使用
TypeIdentifier *varname;
而不是
TypeIdentifier* varname;
这是更合乎逻辑的我为*
修改的类型,而不是变量名。
在提出新问题之前,请先使用搜索 - 已在SO上询问并回答了*多次*。 –
男人,我必须训练我的关键字技巧。感谢您的链接。 @mekici是的,它的确如此。那么,我呢。它有时让我很困惑,我必须仔细看看这个变量究竟是什么类型。 –
Stroustrup建议'Type * name'而不是'Type * name' –