i dont know how to search for a solution for this, so i'll make a new topic for it. first poster
anyway. i have 2 programs, both made in C, only one is windows programming, using win API and all that, the other is a console project.
in the console program i made my own classes, and it all worked fine.
in the windows program, the exact same definition of the class as in the console program, doesn't work, as VStudio drops me a lot of syntax errors about the class definition.
now, my question is: does defining classes when programming windows work differently, or it doesn't work at all ? =/
Code:
class character {
private:
int num;
char name[30];
public:
//methods
};
this passes ok when building a console project.
but when i put this in a .c file which has the WinMain() function and everything else related, i get these syntax errors:
Code:
d:\my docs\Visual Studio Projects\struja_igra\strukture.h(15): error C2061: syntax error : identifier 'character'
d:\my docs\Visual Studio Projects\struja_igra\strukture.h(15): error C2059: syntax error : ';'
d:\my docs\Visual Studio Projects\struja_igra\strukture.h(15): error C2449: found '{' at file scope (missing function header?)
d:\my docs\Visual Studio Projects\struja_igra\strukture.h(15): error C2059: syntax error : '}'
and so on. anyone got any advice for this ? thx