difference between int* i and int *i

前端 未结 8 1077
有刺的猬
有刺的猬 2020-12-01 07:31

I\'m converting a header file for a DLL written in C to Delphi so I can use the DLL.

My question is what is the difference between

int* i

8条回答
  •  情书的邮戳
    2020-12-01 08:07

    Points mentioned above highlight cases where "Type *" makes the most sense.

    But a case where I personally found "Type*" makes intuitive sense/is more readable is when passing a reference to a pointer type. It is non-intuitive to a beginner when reading a variable as :

    int *&x; // what is x here ?

    as opposed to :

    int* (&x); // A reference to a int* type

提交回复
热议问题