I have a static variable in my header. Example:
Header file:
class Fruits{
public:
static int colour;
}
At the cpp file after including the header, is it better to write:
int Fruits::colour=1;
or
int Fruits::colour(1);
Someone told me that the first is not an initialization of the variable but a declaration of another. What is the correct way and place to set the initialization?