S
siddhu
Dear experts,
Let's say we have static member variable in a class declared in a
header file and we define it in a cpp file.
//A.h
class A
{
static int i;
};
//A.cpp
int A::i = 0;
When we define it in a cpp file we also mention the type of of the
variable ( e..g int in this case ).
Is it a redundant information we are giving to the compiler or is
there a logical reasoning behind this?
Regards,
Siddharth
Let's say we have static member variable in a class declared in a
header file and we define it in a cpp file.
//A.h
class A
{
static int i;
};
//A.cpp
int A::i = 0;
When we define it in a cpp file we also mention the type of of the
variable ( e..g int in this case ).
Is it a redundant information we are giving to the compiler or is
there a logical reasoning behind this?
Regards,
Siddharth