N
NR
Hi Folks..
Below is cut paste of one of the "class" in my project... which is
used in
a composition relationship in many other classes.
----------------------------------------------------
/* class declaration*/
class Packet_serialNo
{
public:
Packet_serialNo(word16 value = 0);
~Packet_serialNo();
operator word16() { return serialNo;};
void Set(word16 newVal) { serialNo = newVal;}
private:
word16 serialNo;
};
/* implementation*/
Packet_serialNo:acket_serialNo(word16 value) : serialNo(value){}
Packet_serialNo::~Packet_serialNo(){}
---------------------------------------------------
Can anyone help explain.. how the private member "SerialNo" is gonna
get initialised to some value when the class's constructor gets
called???
Am really unable to understand.. working of the operator overloading
function
"operator word16() { return serialNo;};" in this scenario.
Pls help me understand with ur inputs..
Nits
Below is cut paste of one of the "class" in my project... which is
used in
a composition relationship in many other classes.
----------------------------------------------------
/* class declaration*/
class Packet_serialNo
{
public:
Packet_serialNo(word16 value = 0);
~Packet_serialNo();
operator word16() { return serialNo;};
void Set(word16 newVal) { serialNo = newVal;}
private:
word16 serialNo;
};
/* implementation*/
Packet_serialNo:acket_serialNo(word16 value) : serialNo(value){}
Packet_serialNo::~Packet_serialNo(){}
---------------------------------------------------
Can anyone help explain.. how the private member "SerialNo" is gonna
get initialised to some value when the class's constructor gets
called???
Am really unable to understand.. working of the operator overloading
function
"operator word16() { return serialNo;};" in this scenario.
Pls help me understand with ur inputs..
Nits