int* p与 int *p
时间: 2023-09-18 10:11:49 浏览: 156
int* p与int *p是等价的,都表示定义一个指向int类型的指针变量p。星号可以靠近int或者靠近p,没有区别。这是因为星号是用来修饰p的,而不是修饰int。所以int* p和int *p都是有效的写法。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [int* p;和int *p;应怎样理解(c++语言中星号的位置)?](https://blog.csdn.net/qiuyeyijian/article/details/88080549)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [C语言中指针 int *p=0;和int *p;*p=0;和”&“的关系和区别详解](https://download.csdn.net/download/weixin_38537941/14851842)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文