Timeline for Initializing a nested structure throws error in C++
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 12, 2021 at 14:02 | answer | added | 463035818_is_not_an_ai | timeline score: 2 | |
| Jul 12, 2021 at 13:53 | comment | added | Jorge Bellon |
In C++ you don't need to prepend struct keyword to declare a variable with a structure type, like you need with C. What you are actually doing in your DepartmentData type is declaring a nested type.
|
|
| Jul 12, 2021 at 13:46 | comment | added | HolyBlackCat |
struct EmpData; doesn't do what you think it does. You need something like EmpData data;
|
|
| Jul 12, 2021 at 13:45 | history | asked | ligin pc | CC BY-SA 4.0 |