int *returnSize = malloc(sizeof(int))
时间: 2023-08-17 22:05:45 浏览: 180
引用\[2\]中提到,语句int *returnSize = malloc(sizeof(int))给指针变量returnSize分配了一个整型存储空间。这意味着returnSize指针变量现在可以用来存储一个整数值。需要注意的是,在使用指针变量之前,必须先为其分配相应的内存空间,否则会导致程序异常。
#### 引用[.reference_title]
- *1* [(int*) malloc(SIZE * sizeof(int)) 惨痛的教训](https://blog.csdn.net/Ssure/article/details/8977386)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [C语言(int *)malloc(sizeof(int))的作用与意思](https://blog.csdn.net/u014183815/article/details/107336736)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [‘sizeof’ on array function parameter ‘array’ will return size of ‘int*’](https://blog.csdn.net/weixin_43737395/article/details/123233550)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文