|
发表于 2004-4-28 17:00:50
|
显示全部楼层
%m就是打印转化成字符串表示的errno。我写了个程序来测试:
[php]
#include<stdio.h>
#include<errno.h>
int main()
{
char p = 0;
if (!p) {
printf(" Malloc %m\n");
printf("%s\n",strerror(errno));
exit (1);
}
}
[/php]
运行结果:
[kj501@s2023 c]$ gcc temp.c
temp.c:12:2: warning: no newline at end of file
[kj501@s2023 c]$ ./a.out
Malloc Success
Success
[kj501@s2023 c]$
可以说明问题了吧。 |
|