I have two class(class a , class b), each contained in different .h and .cpp files. I use inlucde of all .h files in all files. And then I have a class b object in class a(please refer to the code).When I compile the program, error shows - " 'bexa' : unknown override specifier" ; "missing type specifier - int assumed. Note: C++ does not support default-int". Why I am having this problem?
thanks beforehand.
Because sometimes if you're working on a project and you have like 5 header files, you forget which is already included. But to do so, you'll need the following syntax:
1 2 3 4 5 6 7 8 9
#ifndef (name of a.h, I prefer it in all caps)
#define (same name, same capslock)
/* class
{
class code
}; I forget whether or not the semicolon outside the class is necessary or not, I've just put it to make the compiler happy*/
#endif
Basically that syntax works like an if,then,else. If a certain header file is not defined inside this .cpp or .h or .anything file, define/include it. Otherwise, do nothing.