F
fcvcnet
Hi,
As we know, a static member viarable is an object associated with the
class, not with the objects of that class. And when we debug the code, we
can not see the value of the member of some particular class, but to me, I
see it, it puzzled me.
What is wrong with my code?
class CSegment
{
public:
....
private:
....
static unsigned int m_numsegment;
};
CSegment::CSegment(void)
: m_pointlist(0)
, m_index(0)
, m_createdirection(true)
{
}
....
class CborderView : public CView
{
....
private:
....
vector <CSegment> m_mylinelist;
....
};
And when I debug the code , I see the value of m_numsegment in every element
of the m_mylinelist, why?
Thanks a lot.
As we know, a static member viarable is an object associated with the
class, not with the objects of that class. And when we debug the code, we
can not see the value of the member of some particular class, but to me, I
see it, it puzzled me.
What is wrong with my code?
class CSegment
{
public:
....
private:
....
static unsigned int m_numsegment;
};
CSegment::CSegment(void)
: m_pointlist(0)
, m_index(0)
, m_createdirection(true)
{
}
....
class CborderView : public CView
{
....
private:
....
vector <CSegment> m_mylinelist;
....
};
And when I debug the code , I see the value of m_numsegment in every element
of the m_mylinelist, why?
Thanks a lot.