I have this function takes more than one char parameters.how to print each of them and add a ‘\n’ at the end of each char?
void printAndSave(char* msg,...)
{
//printing single one.
//printf("Log:%s\n",msg);
//saveToLog(msg);
//how to print all of them?
}
I think you will need to change the signature of
printAndSave()to specify the number ofchar*arguments being passed. For example: