thegrinch
January 31st, 2007, 06:24 AM
Hi!
I am not so familiar with this managed c++, but I have to work with mac addresses in managed code.
I'm trying to implement the ToString() method of a Wrapper Class for Mac-Addresses. So, I tried the following:
System::String * MACAddress::ToString()
{
//b1,b2,... are just private member int's
return System::String::Format(S"%02x-%02x-%02x-%02x-%02x-%02x", b1,b2,b3,b4,b5,b6);
}
doesn't work, since there is no Format(..) method with 7 parameters.
next try:
System::String * MACAddress::ToString()
{
int b[6];
b[0] = _b1;
b[1] = _b2;
b[2] = _b3;
b[3] = _b4;
b[4] = _b5;
b[5] = _b6;
return System::String::Format(S"%02x-%02x-%02x-%02x-%02x-%02x", b);
}
Now, the problem is that b is not of type Object*[].
I'm sure the solution is easy!
Thanks for your help in advance!
Kind regards!
thegrinch
I am not so familiar with this managed c++, but I have to work with mac addresses in managed code.
I'm trying to implement the ToString() method of a Wrapper Class for Mac-Addresses. So, I tried the following:
System::String * MACAddress::ToString()
{
//b1,b2,... are just private member int's
return System::String::Format(S"%02x-%02x-%02x-%02x-%02x-%02x", b1,b2,b3,b4,b5,b6);
}
doesn't work, since there is no Format(..) method with 7 parameters.
next try:
System::String * MACAddress::ToString()
{
int b[6];
b[0] = _b1;
b[1] = _b2;
b[2] = _b3;
b[3] = _b4;
b[4] = _b5;
b[5] = _b6;
return System::String::Format(S"%02x-%02x-%02x-%02x-%02x-%02x", b);
}
Now, the problem is that b is not of type Object*[].
I'm sure the solution is easy!
Thanks for your help in advance!
Kind regards!
thegrinch