c++给结构体初始化
时间: 2023-09-01 13:12:36 浏览: 141
c++结构体的初始化和赋值1
在C语言中,给结构体初始化有几种方式。一种是在定义结构体的同时进行初始化,比如:
```
struct Stu {
int nNum;
bool bSex;
char szName<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [【2016-08-18】转载:总结C++中几种结构体初始化的方法](https://blog.csdn.net/dflkg8956/article/details/101645537)[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: 100%"]
[ .reference_list ]
阅读全文