sizeof数组名和指针
时间: 2023-10-13 18:03:03 浏览: 120
数组名和指针的sizeof是不同的。根据引用中的解释,数组名和指向该数组的指针在地址上是相同的,但是它们的大小不同。数组名的sizeof返回的是整个数组的大小,而指针的sizeof返回的是指针类型的大小。所以,sizeof数组名会返回整个数组的大小,而sizeof指针会返回指针类型的大小。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [探讨C++中数组名与指针的用法比较分析](https://download.csdn.net/download/weixin_38691256/14871672)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [C++/C中 sizeof(指针)和sizeof(数组名)的区别](https://blog.csdn.net/weixin_38383877/article/details/90922929)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [c 语言中的sizeof(数组名)和sizeof(指针)](https://blog.csdn.net/Colorful_lights/article/details/79819682)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文