Multiple Structure instances of the same type inside of another structure
The following code throws the error C10220: DisplayState is already defined in the current scope.
It seems that the compiler only does one pass so anything that a structure depends on needs to be declared before it is used in order to avoid an error. I just I'd throw this up to let everyone else know just in case they ran into the same issue and couldn't figure it out.
Structure VTCPhonebookPreset
{
Char Name[25]
Char Number[15]
}
Structure VTCStatus
{
Char PhoneNumber[15]
VTCPhonebookPreset Preset1
VTCPhonebookPreset Preset2
DisplayState VTCContent
DisplayState VTCCamera
}
Structure DisplayState
{
Integer Power
Integer VideoMute
Char Displaying[10]
Char LampHours[6]
}
It seems that the compiler only does one pass so anything that a structure depends on needs to be declared before it is used in order to avoid an error. I just I'd throw this up to let everyone else know just in case they ran into the same issue and couldn't figure it out.