I have the following structure defined in the header file that I cannot edit (not allowed):
struct Programma
{
enum {SERIE, FILM} programmaType;
char* titel;
char* zender;
time_t start;
time_t einde;
char* review;
union
{
Serie* serie;
Film* film;
} typeData;
};
I tried:
Programma asd;
asd.programmaType = SERIE; //Error: identifier 'SERIE' is undefined
asd.programmaType = 0; //Error: a value of type 'int'cannot be assigned to an entity of type 'enum PRogramma::<unnamed>
and in a function with a pointer to the Programma structure as a parameter replacing '.' by '->', which gave me the same errors.
I think I am doing the same thing as suggested here ( How to use enumeration inside a structure in ANSI C? ), But I can not stop getting random errors.
EDIT: For some reason in Visual Studio, when I print asd. A regular drop-down list appears, but there is an option for "Typedata", as well as "SERIE" and "FILM". Personally, I think that something is wrong with the declaration of the structure, but it was given, and I should not edit it.
EDIT EDIT: ++ Visual Studio 2008, .h, .c. , "C", , .