Hello! I was trying to implement a Static class but I had the following error: "undefined reference to math :: cod" but variable cod is in .h follows the code below class .h and cpp;
#ifndef MATEMATICA_H
#define MATEMATICA_H
class matematica
{
public:
static int getCod();
static void setCod(int);
protected:
private:
static int cod;
};
#endif // MATEMATICA_H
CPP CLASS:
#include "matematica.h"
void matematica::setCod(int c)
{
matematica::cod = c;
}
I do not know what to do.