查找树,俄罗斯方块,系统编程开始

This commit is contained in:
lzy
2024-04-25 21:56:26 +08:00
parent 71fdab3f9f
commit eba0cbb4c4
8 changed files with 305 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
FILE *fp;
fp = fopen("tmp", "r");
if (NULL == fp)
{
// fprintf(stderr, "fopen() failed! errno = %d\n", errno);
// out: fopen() failed! errno = 2
/* errno:定义路径 /usr/include/asm-generic/errno-base.h */
// perror("fopen()");
// out: fopen(): No such file or directory
fprintf(stderr, "fopen(): %s\n", strerror(errno));
// out: fopen(): No such file or directory
exit(1);
}
puts("OK!");
exit(0);
}