From c371e8f6a72438319893eff7d58e37ea335b2137 Mon Sep 17 00:00:00 2001 From: flykhan Date: Fri, 2 Jun 2023 04:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=9A=84=E9=97=B4=E6=8E=A5?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=EF=BC=88=E5=A4=9A=E6=96=87=E4=BB=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3_lesson/03_fun_many_file/.gitignore | 73 +++++++++++++++++++ .../03_fun_many_file/03_fun_many_file.pro | 10 +++ 3_lesson/03_fun_many_file/main.c | 9 +++ 3_lesson/03_fun_many_file/myfun.c | 10 +++ 3_lesson/03_fun_many_file/myfun.h | 6 ++ 5 files changed, 108 insertions(+) create mode 100644 3_lesson/03_fun_many_file/.gitignore create mode 100644 3_lesson/03_fun_many_file/03_fun_many_file.pro create mode 100644 3_lesson/03_fun_many_file/main.c create mode 100644 3_lesson/03_fun_many_file/myfun.c create mode 100644 3_lesson/03_fun_many_file/myfun.h diff --git a/3_lesson/03_fun_many_file/.gitignore b/3_lesson/03_fun_many_file/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/3_lesson/03_fun_many_file/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/3_lesson/03_fun_many_file/03_fun_many_file.pro b/3_lesson/03_fun_many_file/03_fun_many_file.pro new file mode 100644 index 0000000..addd0fc --- /dev/null +++ b/3_lesson/03_fun_many_file/03_fun_many_file.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +CONFIG += console +CONFIG -= app_bundle +CONFIG -= qt + +SOURCES += main.c \ + myfun.c + +HEADERS += \ + myfun.h diff --git a/3_lesson/03_fun_many_file/main.c b/3_lesson/03_fun_many_file/main.c new file mode 100644 index 0000000..2ff3b57 --- /dev/null +++ b/3_lesson/03_fun_many_file/main.c @@ -0,0 +1,9 @@ +#include +#include "myfun.h" + +int main(int argc, char *argv[]) +{ + myfun1(); + + return 0; +} diff --git a/3_lesson/03_fun_many_file/myfun.c b/3_lesson/03_fun_many_file/myfun.c new file mode 100644 index 0000000..2a5e051 --- /dev/null +++ b/3_lesson/03_fun_many_file/myfun.c @@ -0,0 +1,10 @@ +#include "myfun.h" // 此时包含的头文件要使用双引号,在当前目录下找对应头文件 + +void myfun1() +{ + printf("hello world\n"); + printf("nihao beijing\n"); + printf("welcome to 1000phone\n"); + + return ; +} diff --git a/3_lesson/03_fun_many_file/myfun.h b/3_lesson/03_fun_many_file/myfun.h new file mode 100644 index 0000000..3a6bf9c --- /dev/null +++ b/3_lesson/03_fun_many_file/myfun.h @@ -0,0 +1,6 @@ +#ifndef MYFUN_H +#define MYFUN_H + +void myfun1(); + +#endif // MYFUN_H