C++ 不允许指针指向不完整的类类型
时间: 2023-12-28 08:06:12 浏览: 143
C++ 指向类成员的指针
C语言不允许指针指向不完整的类类型。这个问题通常有两个原因。首先,可能是因为没有包含对应结构体的头文件。解决办法是直接添加相应的头文件。另外,可能是因为对应的结构体定义写在了C/CPP文件中而不是头文件中。解决办法是将结构体定义写在对应的头文件中。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [不允许指针指向不完整的类类型](https://blog.csdn.net/weixin_43793181/article/details/119388240)[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: 33.333333333333336%"]
- *2* [Qt错误:不允许指针指向不完整的类类型](https://blog.csdn.net/kevin_lp/article/details/124900439)[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: 33.333333333333336%"]
- *3* [Java自学视频教程-JavaSE基础-配套资料-day02-数据类型、运算符、API介绍、键盘录入.rar](https://download.csdn.net/download/weixin_54787054/88246647)[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: 33.333333333333336%"]
[ .reference_list ]
阅读全文