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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -