I have a function which accepts a character array (ie, string) as argument.
But an integer variable's value should also be printed as part of string.
If I have a function like this:
void printStr(char str)
"The value of var is %d", var
printStr( ("The value of var is %d", var) );
The value of var is 10
It seems that you need the function
snprintf for generation of the string.
Try something like this:
char tempStr; snprintf(tempStr, sizeof(tempStr), "The value of var is %d", var); printStr(tempStr);
Is it what you need?