我得到warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'long unsigned int *' [-Wformat]
下面的代码
unsigned long buf[254];
char systemlogmsg[500]= {'\0'};
snprintf(systemlogmsg, sizeof(systemlogmsg), "INFO: %lu ", buf);
我应该用什么代替%lu
?
此外,我尝试使用
snprintf(systemlogmsg, sizeof(systemlogmsg), "INFO: %lu ", (unsigned long int *) buf);
但它没有帮助。我应该如何通过演员阵容?