Reputation: 553
In ClassA.h I define a struct pointer like:
struct timestr
{
uint64_t timestart;
uint64_t timeend;
};
static timestr *extime;
And in the ClassA.cpp, I initialize like:
timestr *ClassA::extime = NULL;
however I got error: timestr does not name a type. What is wrong here?
Upvotes: 0
Views: 911
Reputation: 409404
Probably because the timestr
structure is inside the containing class, in which case you need to use the scoping for that too:
ClassA::timestr *ClassA::extime = NULL;
Upvotes: 3