P
PSN
Dear all,
I have the following scenerio ..
typedef enum _enReadAs
{
BIN,
DEC,
HEX
}enReadAs;
char* build_message(uint32 &size, bool initialize=false, unsigned char
ini_val=0); // Overload function 1
char* build_message(const char* pbinmsg, enReadAs read, uint32
*size); // Overload function 2
char* build_message(uint32 &size, bool initialize=false, unsigned char
ini_val=0)
{}
char* build_message(const char* pbinmsg, enReadAs read, uint32 *size)
{
switch(read)
{
case BIN:<<<<<<<<<<<<<<<<<
break;
case HEX:<<<<<<<<<<<<<<<<
break;
case DEC:
1. CONVERTS THE CHARACTER STRING
"pbinmsg" TO A HEX CHARACTER STRING, "phexstring"
2. calls: build_message(phexstring, HEX,
*size); // the problem is here !! the compiler thinks im calling the
second
//
overloaded function and complains that it is unable to convert the
first
//
parameter. How can i tell the compiler that im not calling the other
//
overloaded function but the same one.
}
}
ERROR MESSAGE:
Error 5 error C2664: 'unsigned char *binmsg::build_message(unsigned
int &,bool,unsigned char)' : cannot convert parameter 1 from 'const
char *' to 'unsigned int &'
How can I force calling the same overloaded function ???
Hope I was clear .. Please ask me for more information if you need
any !!!
Regards,
Prakash
I have the following scenerio ..
typedef enum _enReadAs
{
BIN,
DEC,
HEX
}enReadAs;
char* build_message(uint32 &size, bool initialize=false, unsigned char
ini_val=0); // Overload function 1
char* build_message(const char* pbinmsg, enReadAs read, uint32
*size); // Overload function 2
char* build_message(uint32 &size, bool initialize=false, unsigned char
ini_val=0)
{}
char* build_message(const char* pbinmsg, enReadAs read, uint32 *size)
{
switch(read)
{
case BIN:<<<<<<<<<<<<<<<<<
break;
case HEX:<<<<<<<<<<<<<<<<
break;
case DEC:
1. CONVERTS THE CHARACTER STRING
"pbinmsg" TO A HEX CHARACTER STRING, "phexstring"
2. calls: build_message(phexstring, HEX,
*size); // the problem is here !! the compiler thinks im calling the
second
//
overloaded function and complains that it is unable to convert the
first
//
parameter. How can i tell the compiler that im not calling the other
//
overloaded function but the same one.
}
}
ERROR MESSAGE:
Error 5 error C2664: 'unsigned char *binmsg::build_message(unsigned
int &,bool,unsigned char)' : cannot convert parameter 1 from 'const
char *' to 'unsigned int &'
How can I force calling the same overloaded function ???
Hope I was clear .. Please ask me for more information if you need
any !!!
Regards,
Prakash