difference between int* i and int *i

前端 未结 8 1049
有刺的猬
有刺的猬 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:11

    As far as C goes they both do the same thing. It is a matter of preference. int* i shows clearly that it is an int pointer type. int *i shows the fact that the asterisk only affects a single variable. So int *i, j and int* i, j would both create i as an int pointer and j as an int.

提交回复
热议问题