#include <stdio.h>
1、fprintf
fprintf(stderr, "Socket error: (errno: %d) %s\r\n", errno, strerror(errno));
2、perror
extern void perror (__const char *__s);
eg:
perror("malloc");
3、@@todo
1、fprintf
fprintf(stderr, "Socket error: (errno: %d) %s\r\n", errno, strerror(errno));
2、perror
extern void perror (__const char *__s);
eg:
perror("malloc");
3、
本文介绍了两种在C语言中常用的错误处理方法:使用fprintf直接输出错误信息到标准错误流和使用perror函数打印错误信息及其描述。这两种方法对于调试程序非常有用。

1469

被折叠的 条评论
为什么被折叠?



