I get warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long unsigned int *' [-Wformat]
for the code below
unsigned long buf[254];
char systemlogmsg[500]= {'\0'};
snprintf(systemlogmsg, sizeof(systemlogmsg), "INFO: %lu ", buf);
what should I have used instead of %lu
?
Furthermore, I tried to use
snprintf(systemlogmsg, sizeof(systemlogmsg), "INFO: %lu ", (unsigned long int *) buf);
but it did not help. How should I have passed the cast?