|
Ninji Birdo Why did my user title say I'm a toaster anyway Level: 88 Posts: 141/2014 EXP: 6639499 For next: 11165 Since: 07-26-07 Pronouns: he/him or they/them From: Glasgow, Scotland Since last post: 115 days Last activity: 7 days |
|
Repost from board2.
Okay, this is going to be weird, but. Why can't I define a class and make a variable of it in another file? It makes no sense. It should be possible, but I don't know how. I'm using Visual Studio 2008. This is basically what I have: Main.cpp + Defining this: Tileset** Tilesets; (to make a pointer to an array of pointers to Tileset classes - this line is where all errors occur) + Main function and other things Graphics.cpp + Definition of tileset class Why does the compiler act as if I have no Tileset class? Moving the Tileset class definition into Main.cpp, before the problematic line, fixes it. Is there something I can do to fix this? I'm kind of new to coding in C++. ____________________ |




I don't really like them, coming from a C# background - I'd rather keep my class methods and declaration in the same place if possible.


