badri1
March 7th, 2006, 01:19 PM
Hey All -
I want to send a string as a formated string to a function... meaning
say the function name is LOG
so i want to do a function call as
LOG("The integer valu is %d",iValue);
this string shd go as "The integer valu is 10", if iValue is 10....
i tried declaring the function as
void LOGGER(char *chpLog, ...) // (i tried to use the eclips operator)
{
-------
}
but the value of chpLog is comming as "The integer valu is %d"... do any one know how to tackle this ??
I know we can format the string using sprintf or CString::Format()..... but all these requires another variable and memory ...which i dont want to spend...!!
can it be solved using 'vararg' functions??... does any one know its implementation????
I want to send a string as a formated string to a function... meaning
say the function name is LOG
so i want to do a function call as
LOG("The integer valu is %d",iValue);
this string shd go as "The integer valu is 10", if iValue is 10....
i tried declaring the function as
void LOGGER(char *chpLog, ...) // (i tried to use the eclips operator)
{
-------
}
but the value of chpLog is comming as "The integer valu is %d"... do any one know how to tackle this ??
I know we can format the string using sprintf or CString::Format()..... but all these requires another variable and memory ...which i dont want to spend...!!
can it be solved using 'vararg' functions??... does any one know its implementation????