🦄 refactor(C13, C14, C115): 更新了linux系统开发部分的结构
This commit is contained in:
37
C14-文件系统/atexit.c
Normal file
37
C14-文件系统/atexit.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void f1(void)
|
||||
{
|
||||
puts("f1() is working!");
|
||||
}
|
||||
|
||||
static void f2(void)
|
||||
{
|
||||
puts("f2() is working!");
|
||||
}
|
||||
|
||||
static void f3(void)
|
||||
{
|
||||
puts("f3() is working!");
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
puts("Begin!");
|
||||
|
||||
atexit(f1);
|
||||
atexit(f2);
|
||||
atexit(f3);
|
||||
|
||||
puts("End!");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
// out:
|
||||
// *[main][~/Linux-C-Notes/C13-Linux系统编程/fs]$ ./atexit
|
||||
// Begin!
|
||||
// End!
|
||||
// f3() is working!
|
||||
// f2() is working!
|
||||
// f1() is working!
|
||||
Reference in New Issue
Block a user