From ca8d7997e3eb4e115679047bc2525387be75f0bf Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Sat, 22 Feb 2025 23:34:15 +0900 Subject: [PATCH 01/22] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=8B=A4=EC=8A=B5?= =?UTF-8?q?=20=EC=86=94=EB=A3=A8=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + Computer-Programming-and-Practice-2025-1.sln | 31 ++++ ...er-Programming-and-Practice-2025-1.vcxproj | 135 ++++++++++++++++++ ...amming-and-Practice-2025-1.vcxproj.filters | 14 ++ main.c | 8 ++ 5 files changed, 190 insertions(+) create mode 100644 .gitignore create mode 100644 Computer-Programming-and-Practice-2025-1.sln create mode 100644 Computer-Programming-and-Practice-2025-1.vcxproj create mode 100644 Computer-Programming-and-Practice-2025-1.vcxproj.filters create mode 100644 main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2cf5bc1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.vs +Computer-Programming-and-Practice-2025-1.vcxproj.user diff --git a/Computer-Programming-and-Practice-2025-1.sln b/Computer-Programming-and-Practice-2025-1.sln new file mode 100644 index 0000000..cfa80bc --- /dev/null +++ b/Computer-Programming-and-Practice-2025-1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35818.85 d17.13 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Computer-Programming-and-Practice-2025-1", "Computer-Programming-and-Practice-2025-1.vcxproj", "{56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.ActiveCfg = Debug|x64 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.Build.0 = Debug|x64 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x86.ActiveCfg = Debug|Win32 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x86.Build.0 = Debug|Win32 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x64.ActiveCfg = Release|x64 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x64.Build.0 = Release|x64 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x86.ActiveCfg = Release|Win32 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7548D284-3031-4A53-8359-876BE48586E0} + EndGlobalSection +EndGlobal diff --git a/Computer-Programming-and-Practice-2025-1.vcxproj b/Computer-Programming-and-Practice-2025-1.vcxproj new file mode 100644 index 0000000..e1d6efa --- /dev/null +++ b/Computer-Programming-and-Practice-2025-1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {56298b6a-7bcc-4ad5-857c-3ae51b8ca9fa} + ComputerProgrammingandPractice20251 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Computer-Programming-and-Practice-2025-1.vcxproj.filters b/Computer-Programming-and-Practice-2025-1.vcxproj.filters new file mode 100644 index 0000000..3366b87 --- /dev/null +++ b/Computer-Programming-and-Practice-2025-1.vcxproj.filters @@ -0,0 +1,14 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + c + + + + + 소스 파일 + + + \ No newline at end of file diff --git a/main.c b/main.c new file mode 100644 index 0000000..8ab6291 --- /dev/null +++ b/main.c @@ -0,0 +1,8 @@ +/* �ּ� */ +// �ּ��� /*�� �����ؼ� */�� �����ϴ�. +// C99���ʹ� //�ε� �ּ��� �� �� �ֽ��ϴ�. +// //�� ���� �ּ��� ���� �������Դϴ�. + +int main() { + return 0; +} From 161bb958ec755565290ff3af25e305ebd6273626 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Sun, 23 Feb 2025 23:16:48 +0900 Subject: [PATCH 02/22] Update main.c --- main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 8ab6291..6c79fa7 100644 --- a/main.c +++ b/main.c @@ -1,8 +1,14 @@ -/* �ּ� */ -// �ּ��� /*�� �����ؼ� */�� �����ϴ�. -// C99���ʹ� //�ε� �ּ��� �� �� �ֽ��ϴ�. -// //�� ���� �ּ��� ���� �������Դϴ�. +/* 함수 실행 */ +/* + 이름이 five고, 입력값이 없는 함수를 실행하는 문법은 + five() 입니다. + 함수를 실행하고나면 결과값을 얻습니다. + 결과값을 값 대신에 쓸 수 있습니다. +*/ + +/* To Do: 5를 결과값으로 반환하는 five 함수를 정의하기 */ int main() { + /* To Do: 결과값을 five 함수의 실행 결과로 바꾸기 */ return 0; } From 2926d041cc9ebb236f005c7eaa688488b2ac3c8d Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Sun, 23 Feb 2025 23:33:54 +0900 Subject: [PATCH 03/22] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2cf5bc1..bc46f2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/.vs +*/* Computer-Programming-and-Practice-2025-1.vcxproj.user From 95c4f5f15edd92bf2dacbd93cc16f49fe97a8f59 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Mon, 24 Feb 2025 17:21:25 +0900 Subject: [PATCH 04/22] Update main.c --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 6c79fa7..e865e41 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,8 @@ -/* 함수 실행 */ +/* 함수 선언 */ /* - 이름이 five고, 입력값이 없는 함수를 실행하는 문법은 - five() 입니다. + 소스 파일에 함수에 대한 정의가 있더라도, + 함수를 실행하는 문장 뒤에 있는 경우 + C 함수를 실행하고나면 결과값을 얻습니다. 결과값을 값 대신에 쓸 수 있습니다. */ From 9a2d2d0c9927d4335d601b0499f9d76a548ec967 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Mon, 24 Feb 2025 17:31:38 +0900 Subject: [PATCH 05/22] Update main.c --- main.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index e865e41..804153f 100644 --- a/main.c +++ b/main.c @@ -1,15 +1,25 @@ /* 함수 선언 */ /* - 소스 파일에 함수에 대한 정의가 있더라도, - 함수를 실행하는 문장 뒤에 있는 경우 - C - 함수를 실행하고나면 결과값을 얻습니다. - 결과값을 값 대신에 쓸 수 있습니다. + 함수 정의가 함수 실행 문장 뒤에 있는 경우, + 함수 실행 문장에서 함수를 확인할 수 없습니다. + 이런 경우에 함수 선언을 통해 함수의 + 이름, 입력값 종류, 출력값 종류를 정해놓습니다. + 함수 정의는 보통 소스 파일의 가장 앞에서 합니다. */ -/* To Do: 5를 결과값으로 반환하는 five 함수를 정의하기 */ +/* To Do: 5를 결과값으로 반환하고, 입력값이 없는 five 함수를 선언하기 */ int main() { - /* To Do: 결과값을 five 함수의 실행 결과로 바꾸기 */ - return 0; + return five(); +} + +/* + 함수 이름: five + 입력값: 없음 + 출력값: int + + five()는 5를 결과값으로 반환한다. +*/ +int five() { + return 5; } From b19bbbe10c633ff007591181c0efa76620ff844f Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Mon, 24 Feb 2025 17:46:04 +0900 Subject: [PATCH 06/22] Update main.c --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 804153f..e7c3387 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ 함수 실행 문장에서 함수를 확인할 수 없습니다. 이런 경우에 함수 선언을 통해 함수의 이름, 입력값 종류, 출력값 종류를 정해놓습니다. - 함수 정의는 보통 소스 파일의 가장 앞에서 합니다. + 함수 선언은 보통 소스 파일의 가장 앞에서 합니다. */ /* To Do: 5를 결과값으로 반환하고, 입력값이 없는 five 함수를 선언하기 */ From 5e6afcb044134faa633bc9d34d63ddf55421645b Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Thu, 6 Mar 2025 23:42:38 +0900 Subject: [PATCH 07/22] Update main.c --- main.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/main.c b/main.c index e7c3387..b7392a2 100644 --- a/main.c +++ b/main.c @@ -1,25 +1,24 @@ -/* 함수 선언 */ +/* 함수의 매개변수 */ /* - 함수 정의가 함수 실행 문장 뒤에 있는 경우, - 함수 실행 문장에서 함수를 확인할 수 없습니다. - 이런 경우에 함수 선언을 통해 함수의 - 이름, 입력값 종류, 출력값 종류를 정해놓습니다. - 함수 선언은 보통 소스 파일의 가장 앞에서 합니다. + 매개변수는 함수가 호출할때 전달된 값(인자 또는 인수로 부릅니다)으로 초기화되는 변수입니다. + 함수가 실행될 때 만들어지고, 함수가 종료될 때 없어집니다. + 매개변수를 쓰려면 함수 선언 및 정의에서 ( ) 안에 타입과 이름을 적으면 됩니다. + 매개변수가 있는 함수의 선언은 타입 이름 ( 타입 이름 ) ; 이고, + 매개변수가 있는 함수의 정의는 타입 이름 ( 타입 이름 ) { } 입니다. + 매개변수가 있는 함수를 호출하는 식은 식 ( 식 ) 입니다. + 괄호 왼쪽 식은 호출할 함수를 가리키고, 괄호 안의 식은 인자가 됩니다. */ -/* To Do: 5를 결과값으로 반환하고, 입력값이 없는 five 함수를 선언하기 */ +/* To Do: 함수 add1의 선언에서 매개변수를 추가해보세요. 매개변수의 타입은 int이고, 이름은 number로 해보세요. */ +int add1(); int main() { - return five(); + /* To Do: 함수 add1의 호출식에 값이 1인 인자를 넣어보세요 */ + return add1(); } -/* - 함수 이름: five - 입력값: 없음 - 출력값: int - - five()는 5를 결과값으로 반환한다. -*/ -int five() { - return 5; +/* To Do: 함수 add1의 정의에서 매개변수를 추가해보세요. 매개변수의 타입은 int이고, 이름은 x로 해보세요. */ +int add1() { + /* To Do: 반환 값을 매개변수 x에 1을 더한 값으로 바꿔보세요 */ + return 0; } From 3147de199e6cf9ea2329ba8674e5c53da8a305d4 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 16:43:49 +0900 Subject: [PATCH 08/22] Update README.md --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb3e4ff..6352446 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -# Computer Programming and Practice 2025-1 - 컴퓨터 프로그래밍 및 실습 과목의 수업 홈페이지 +# 함수호출식 (매개변수가 없는 함수) + +함수를 실행하는 것을 함수를 호출한다고 합니다. +함수를 호출하는 것은 값을 쓰거나 더하기를 하는 것처럼 결과로 값을 얻습니다. +실행 결과를 얻는 것을 식이라고 하고, 식은 문장의 일부로 쓰입니다. + +`식` `(` `)` 형태로 씁니다. + +`(` 왼쪽의 `식`은 함수를 가리켜야 합니다. + +#### 코드 예시: +```c +int main() { + return main(); /* 자신을 무한히 호출해서 에러가 발생합니다 */ +} +``` From 0b3bd9a2f6eed6b0c9f7d72d2e1d3fd7b00d7dfb Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:03:31 +0900 Subject: [PATCH 09/22] Create .editorconfig --- .editorconfig | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8d3a3fd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*.c] +charset = utf-8 From dc0807ee9eef4ae5b726d90365ca5d09e80ee7fc Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:04:03 +0900 Subject: [PATCH 10/22] Update .gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bc46f2c..4c65a21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -*/* -Computer-Programming-and-Practice-2025-1.vcxproj.user +* +!main.c From a26ad621fac03f9b435f2afa9a3c17e6502bb304 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:10:01 +0900 Subject: [PATCH 11/22] Update and rename Computer-Programming-and-Practice-2025-1.sln to Solution-Week1.sln --- Computer-Programming-and-Practice-2025-1.sln | 31 -------------------- Solution-Week1.sln | 22 ++++++++++++++ 2 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 Computer-Programming-and-Practice-2025-1.sln create mode 100644 Solution-Week1.sln diff --git a/Computer-Programming-and-Practice-2025-1.sln b/Computer-Programming-and-Practice-2025-1.sln deleted file mode 100644 index cfa80bc..0000000 --- a/Computer-Programming-and-Practice-2025-1.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.13.35818.85 d17.13 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Computer-Programming-and-Practice-2025-1", "Computer-Programming-and-Practice-2025-1.vcxproj", "{56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.ActiveCfg = Debug|x64 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.Build.0 = Debug|x64 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x86.ActiveCfg = Debug|Win32 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x86.Build.0 = Debug|Win32 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x64.ActiveCfg = Release|x64 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x64.Build.0 = Release|x64 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x86.ActiveCfg = Release|Win32 - {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7548D284-3031-4A53-8359-876BE48586E0} - EndGlobalSection -EndGlobal diff --git a/Solution-Week1.sln b/Solution-Week1.sln new file mode 100644 index 0000000..7466781 --- /dev/null +++ b/Solution-Week1.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35818.85 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project-Function-Calls-No-Parameter", "Project-Function-Calls-No-Parameter.vcxproj", "{56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.ActiveCfg = Debug|x64 + {56298B6A-7BCC-4AD5-857C-3AE51B8CA9FA}.Debug|x64.Build.0 = Debug|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7548D284-3031-4A53-8359-876BE48586E0} + EndGlobalSection +EndGlobal From a0a2c342ca48fcafa1fce15f79d7cce732b1048e Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:12:39 +0900 Subject: [PATCH 12/22] Update and rename Computer-Programming-and-Practice-2025-1.vcxproj to Project-Function-Calls-No-Parameter.vcxproj --- ...er-Programming-and-Practice-2025-1.vcxproj | 135 ------------------ Project-Function-Calls-No-Parameter.vcxproj | 50 +++++++ 2 files changed, 50 insertions(+), 135 deletions(-) delete mode 100644 Computer-Programming-and-Practice-2025-1.vcxproj create mode 100644 Project-Function-Calls-No-Parameter.vcxproj diff --git a/Computer-Programming-and-Practice-2025-1.vcxproj b/Computer-Programming-and-Practice-2025-1.vcxproj deleted file mode 100644 index e1d6efa..0000000 --- a/Computer-Programming-and-Practice-2025-1.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {56298b6a-7bcc-4ad5-857c-3ae51b8ca9fa} - ComputerProgrammingandPractice20251 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/Project-Function-Calls-No-Parameter.vcxproj b/Project-Function-Calls-No-Parameter.vcxproj new file mode 100644 index 0000000..8ab5aab --- /dev/null +++ b/Project-Function-Calls-No-Parameter.vcxproj @@ -0,0 +1,50 @@ + + + + + Debug + x64 + + + + 17.0 + Win32Proj + {56298b6a-7bcc-4ad5-857c-3ae51b8ca9fa} + ComputerProgrammingandPractice20251 + 10.0 + + + + Application + true + v143 + Unicode + + + + + + + + + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + + + From 047d120e2d29fcf71450205ce0f8bf35007ab500 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:13:32 +0900 Subject: [PATCH 13/22] Rename Computer-Programming-and-Practice-2025-1.vcxproj.filters to Project-Function-Calls-No-Parameter.vcxproj.filters --- ...lters => Project-Function-Calls-No-Parameter.vcxproj.filters | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Computer-Programming-and-Practice-2025-1.vcxproj.filters => Project-Function-Calls-No-Parameter.vcxproj.filters (97%) diff --git a/Computer-Programming-and-Practice-2025-1.vcxproj.filters b/Project-Function-Calls-No-Parameter.vcxproj.filters similarity index 97% rename from Computer-Programming-and-Practice-2025-1.vcxproj.filters rename to Project-Function-Calls-No-Parameter.vcxproj.filters index 3366b87..16285ee 100644 --- a/Computer-Programming-and-Practice-2025-1.vcxproj.filters +++ b/Project-Function-Calls-No-Parameter.vcxproj.filters @@ -11,4 +11,4 @@ 소스 파일 - \ No newline at end of file + From 6f81a2c804af7ba3000aed2aa9c37a746e32f4df Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:14:52 +0900 Subject: [PATCH 14/22] Update Project-Function-Calls-No-Parameter.vcxproj --- Project-Function-Calls-No-Parameter.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project-Function-Calls-No-Parameter.vcxproj b/Project-Function-Calls-No-Parameter.vcxproj index 8ab5aab..faa1650 100644 --- a/Project-Function-Calls-No-Parameter.vcxproj +++ b/Project-Function-Calls-No-Parameter.vcxproj @@ -10,7 +10,7 @@ 17.0 Win32Proj {56298b6a-7bcc-4ad5-857c-3ae51b8ca9fa} - ComputerProgrammingandPractice20251 + ProjectFunctionCallsNoParameter 10.0 From 0622b544ff6b331205f8f765cfd9824ad9903793 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 17:52:49 +0900 Subject: [PATCH 15/22] Update main.c --- main.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/main.c b/main.c index b7392a2..8ebb510 100644 --- a/main.c +++ b/main.c @@ -1,24 +1,20 @@ -/* 함수의 매개변수 */ -/* - 매개변수는 함수가 호출할때 전달된 값(인자 또는 인수로 부릅니다)으로 초기화되는 변수입니다. - 함수가 실행될 때 만들어지고, 함수가 종료될 때 없어집니다. - 매개변수를 쓰려면 함수 선언 및 정의에서 ( ) 안에 타입과 이름을 적으면 됩니다. - 매개변수가 있는 함수의 선언은 타입 이름 ( 타입 이름 ) ; 이고, - 매개변수가 있는 함수의 정의는 타입 이름 ( 타입 이름 ) { } 입니다. - 매개변수가 있는 함수를 호출하는 식은 식 ( 식 ) 입니다. - 괄호 왼쪽 식은 호출할 함수를 가리키고, 괄호 안의 식은 인자가 됩니다. -*/ +/* 매개변수가 없는 함수의 호출식 */ -/* To Do: 함수 add1의 선언에서 매개변수를 추가해보세요. 매개변수의 타입은 int이고, 이름은 number로 해보세요. */ -int add1(); +/* 문법 + * 식 ( ) 형태로 함수호출식을 씁니다. + * 여기서의 식은 함수를 가리켜야 합니다. 함수 이름 등이 가능합니다. + * + * 의미 + * 함수를 실행합니다. + * 함수에서 반환한 값이 식의 결과값이 됩니다. + */ -int main() { - /* To Do: 함수 add1의 호출식에 값이 1인 인자를 넣어보세요 */ - return add1(); +/* five는 int 타입의 값인 5를 반환하는 함수입니다. */ +int five() { + return 5; } -/* To Do: 함수 add1의 정의에서 매개변수를 추가해보세요. 매개변수의 타입은 int이고, 이름은 x로 해보세요. */ -int add1() { - /* To Do: 반환 값을 매개변수 x에 1을 더한 값으로 바꿔보세요 */ +int main() { + /* To Do: five()를 호출한 결과를 반환해보세요 */ return 0; } From 7325ce849eb6a257e3cb86dc131f35abb422dcc8 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Tue, 11 Mar 2025 23:49:01 +0900 Subject: [PATCH 16/22] Rename Solution-Week1.sln to Solution-Week2.sln --- Solution-Week1.sln => Solution-Week2.sln | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Solution-Week1.sln => Solution-Week2.sln (100%) diff --git a/Solution-Week1.sln b/Solution-Week2.sln similarity index 100% rename from Solution-Week1.sln rename to Solution-Week2.sln From 9b875d6ec2274f757b3ab59a74bf4c9f230a92dc Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Thu, 13 Mar 2025 00:25:06 +0900 Subject: [PATCH 17/22] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 6352446..337de3a 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,11 @@ int main() { return main(); /* 자신을 무한히 호출해서 에러가 발생합니다 */ } ``` + +#### 관련 C89 표준 +3.3.2.2 Function calls +> Semantics +> +> ... expression followed by parentheses () containing a possibly empty ... is a function call. +> ... expression denotes the called function. ... +> ... Recursive function calls shall be permitted, both directly and indirectly through any chain of other functions. From 23805f0141c2399845d35343c7e587ced5c382c3 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Thu, 13 Mar 2025 00:25:22 +0900 Subject: [PATCH 18/22] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 337de3a..393da18 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,7 @@ int main() { > Semantics > > ... expression followed by parentheses () containing a possibly empty ... is a function call. +> > ... expression denotes the called function. ... +> > ... Recursive function calls shall be permitted, both directly and indirectly through any chain of other functions. From 5a58af8c105a529e105e84f08939512ee8a311e5 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Thu, 13 Mar 2025 00:25:53 +0900 Subject: [PATCH 19/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 393da18..6a13686 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ int main() { 3.3.2.2 Function calls > Semantics > -> ... expression followed by parentheses () containing a possibly empty ... is a function call. +> ... expression followed by parentheses () ... is a function call. > > ... expression denotes the called function. ... > From 4d28b0ca47cc591c1728e29e4a06d152359e7681 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Fri, 14 Mar 2025 00:36:35 +0900 Subject: [PATCH 20/22] Update main.c --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 8ebb510..a2ea8d1 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* 매개변수가 없는 함수의 호출식 */ +/* 매개변수가 없는 함수의 호출식 */ /* 문법 * 식 ( ) 형태로 함수호출식을 씁니다. From b900d7d0a7d6150d36b5676672de65049d574974 Mon Sep 17 00:00:00 2001 From: chaebkimm Date: Fri, 14 Mar 2025 01:01:02 +0900 Subject: [PATCH 21/22] Update Project-Function-Calls-No-Parameter.vcxproj --- Project-Function-Calls-No-Parameter.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Project-Function-Calls-No-Parameter.vcxproj b/Project-Function-Calls-No-Parameter.vcxproj index faa1650..47760fe 100644 --- a/Project-Function-Calls-No-Parameter.vcxproj +++ b/Project-Function-Calls-No-Parameter.vcxproj @@ -35,6 +35,7 @@ true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true + /utf-8 %(AdditionalOptions) Console From 0d376b4580a29d4580e66cb6c58f3af5d51a6956 Mon Sep 17 00:00:00 2001 From: cm-3c_cd_93_7A_83_9C Date: Fri, 14 Mar 2025 14:22:24 +0900 Subject: [PATCH 22/22] Update main.c --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index a2ea8d1..81c68df 100644 --- a/main.c +++ b/main.c @@ -16,5 +16,5 @@ int five() { int main() { /* To Do: five()를 호출한 결과를 반환해보세요 */ - return 0; + return five(); }