第二章完结

This commit is contained in:
lzy
2024-03-12 22:05:13 +08:00
parent d64b6fe321
commit 0e9bf09117
15 changed files with 282 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
int main()
{
FILE *fp;
fp = fopen("tmp", "r");
if (fp == NULL)
{
fprintf(stderr, "fopen():%s\n", strerror(errno));
exit(1);
}
puts("ok!");
exit(0);
}

View File

@@ -0,0 +1,12 @@
#include <stdio.h>
int main(void)
{
int *p = NULL;
int i;
p = (int *)malloc(sizeof(int));
if (p == NULL)
return -1;
printf("Hello world!\n");
return 0;
}

View File

@@ -0,0 +1,6 @@
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
}