c++ - Compilation error: `Class' does not name a type -


i have pretty simple class called simulator in simulator.h

#include <iostream.h> #include <stdlib.h>  class simulator {     private:       short int startfloor;       short int destfloor;      public:           void setfloors();           void getfloors(short int &, short int &);    };   

now when compile it, error:
simulator.h:4: error: `class' not name type

what have got wrong here?

you need make class lowercase (and should stop using deprecated iostream.h header):

#include <iostream> #include <cstdlib>  class simulator {     // stuff here } 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -