   Inheritance Error: expected class-name before '' token
  Hi, I've been travelling around Google all day and so far nothing like this error has been solved. Not sure what's wrong with this but it only comes up when a subclass is created. Please help! :oBase class (game.h)://#include "gameplatform.h"#ifndef GAME_H_#define GAME_H_class Game{public:void setGame(char gamename[], char gameplatform[], char gamerating[], float gameprice);    char* getName();    char* getPlatform();    char* getRating();    float getPrice();   private:   char gname[25];    char gplatform[25];    char grating[10];    float gprice; };#endifgame.cpp:#include &lt;cstdlib&gt;#include &lt;iostream&gt;#include "game.h"#include &lt;stdio.h&gt;#include &lt;string.h&gt;void Game::setGame(char gamename[], char gameplatform[], char gamerating[], float gameprice){//Copy the array to another variablestrcpy(gname,gamename);strcpy(gplatform,gameplatform);strcpy(grating,gamerating);gprice = gameprice;}char* Game::getName(){ //Return this variable return gname;}char* Game::getPlatform(){ //Return this variable return gplatform;}char* Game::getRating(){ //Return this variable return grating;}float Game::getPrice(){ //Return this variable return gprice;}Subclass(gameplatform.h):#ifndef GAMEPLATFORM_H_#define GAMEPLATFORM_H_//#include "game.h"class gameplat: public game{  public:   void thisfunction();    private: };#endif /*For Game Platform*/gameplatform.cpp:#include "gameplatform.h"#include &lt;cstdlib&gt;#include &lt;iostream&gt;#include &lt;stdio.h&gt;#include &lt;string.h&gt;void thisfunction(){}The int main() is currently empty. I tried to make it work without any code just:system("PAUSE");    return EXIT_SUCCESS;Every times it compiles it comes up with the same error. :([Edited by - DizzyKuma on June 4, 2009 11:38:19 AM]
  game.h#ifndef GAME_H_#define GAME_H_// In C++, we use std::string instead of char arrays#include <string>class Game{public:void setGame( const std::string& gamename, const std::string& gameplatform, const std::string& gamerating, float gameprice );// Return const references to our strings instead of the entire stringconst std::string& getName();const std::string& getPlatform();const std::string& getRating();float getPrice();private:std::string gname;std::string gplatform;std::string grating;float gprice;};#endifgame.cpp#include "game.h"// #include <iostream> // Only include headers you're usingvoid Game::setGame( const std::string& gamename, const std::string& gameplatform, const std::string& gamerating, float gameprice ) :// You can construct member variables here in what's called an initializer-list:gname( gamename ),  // this copies the string referenced from gamename to gnamegplatform( gameplatform ),grating( gamerating ),gprice( gameprice ){}const std::string& Game::getName(){return gname;}const std::string& Game::getPlatform(){return gplatform;}const std::string& Game::getRating(){return grating;}float Game::getPrice(){return gprice;}gameplatform.h#ifndef GAMEPLATFORM_H_#define GAMEPLATFORM_H_// In order for gameplat to inherit from Game, it needs to know// all about Game before deriving from it :)#include "game.h" class gameplat : public Game{public:void thisfunction();};#endif /*For Game Platform*/gameplatform.cpp#include "gameplatform.h"// #include <cstdlib>// Only include header files you're using// #include <iostream>// #include <stdio.h>// #include <string.h>// I think you meant "gameplat::thisfunction()" instead of "thisfunction()"void gameplat::thisfunction(){}You can use [source][/source] tags to format your code.  [smile]EDIT:I see that you have a system("PAUSE"); there, so I'll assume you're on a Windows platform.  If you're not using it already, get Microsoft Visual C++ 2008 Express Edition.[Edited by - _fastcall on June 4, 2009 11:09:20 AM];  _fastcall beat me to and just fixed your code but that error means that the compiler couldn't figure out how to resolve the class name at compile time, hence is complaining about it. ;  you were trying to inherit from a class called "game" that doesn't exist.  You need to inherit from a class called "Game"   