Initial commit
This commit is contained in:
BIN
Chapter1/Section2/hello
Executable file
BIN
Chapter1/Section2/hello
Executable file
Binary file not shown.
16
Chapter1/Section2/hello.c
Normal file
16
Chapter1/Section2/hello.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if 0
|
||||
void main(void);
|
||||
void main(int argc, char **argv);// char *argv[]
|
||||
int main(int argc, char **argv);
|
||||
int main(void);
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
BIN
Chapter1/Section3/a
Executable file
BIN
Chapter1/Section3/a
Executable file
Binary file not shown.
18
Chapter1/Section3/a.c
Normal file
18
Chapter1/Section3/a.c
Normal 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);
|
||||
}
|
||||
BIN
Chapter1/Section3/a.out
Executable file
BIN
Chapter1/Section3/a.out
Executable file
Binary file not shown.
BIN
Chapter1/Section3/hello
Executable file
BIN
Chapter1/Section3/hello
Executable file
Binary file not shown.
12
Chapter1/Section3/hello.c
Normal file
12
Chapter1/Section3/hello.c
Normal 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;
|
||||
}
|
||||
BIN
Chapter1/Section3/return
Executable file
BIN
Chapter1/Section3/return
Executable file
Binary file not shown.
6
Chapter1/Section3/return.c
Normal file
6
Chapter1/Section3/return.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello world!\n");
|
||||
}
|
||||
Reference in New Issue
Block a user