--- id: c-functions title: "C Functions" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["void function", "function call", "C ν•¨μˆ˜"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.86 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["c", "programming-language", "w3schools", "functions"] raw_sources: ["https://www.w3schools.com/c/c_functions.php"] applied_in: [] github_commit: "" --- # [[C Functions]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The source reveals that `main()` and `printf()` β€” the two things every C beginner types on day one β€” are ALREADY functions, meaning the concept being "introduced" in this chapter isn't new at all; the learner has been using functions the entire tutorial without a name for it, and this chapter is really just formalizing vocabulary for a pattern already internalized. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Function** β€” a block of code that only runs when explicitly CALLED, not automatically at declaration time. [S1] - **`void` return type** β€” indicates the function returns no value (covered in more depth in the Parameters chapter). [S1] - **Declaration vs. execution timing** β€” declaring a function only "saves it for later use"; nothing inside runs until it's called. [S1] - **Repeatable calls** β€” the same function can be called multiple times, each execution independent. [S1] - **Code reuse motivation** β€” "define the code once, and use it many times" is the core justification for functions. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Calling the same function three times: `void myFunction() { printf("I just got executed!"); } int main() { myFunction(); myFunction(); myFunction(); return 0; }` β€” prints the message three times. [S1] - A function performing a fixed calculation: `void calculateSum() { int x = 5; int y = 10; int sum = x + y; printf("The sum of x + y is: %d", sum); }` β€” explicitly noted as LIMITED since x/y are hardcoded, motivating the next chapter's parameters. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - ν˜„μž¬κΉŒμ§€ 발견된 λͺ¨μˆœ 사항 μ—†μŒ (No contradictions found in available sources). ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” main()κ³Ό printf() μžμ²΄κ°€ 이미 ν•¨μˆ˜λΌλŠ” 사싀을 μƒκΈ°μ‹œν‚€λŠ” 것이 이 μ±•ν„°μ˜ 핡심 μ‹€μ „ 톡찰이닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Calling the same function multiple times (C): ```c void myFunction() { printf("I just got executed!"); } int main() { myFunction(); myFunction(); myFunction(); return 0; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.86 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[C Memory RealLife]], [[C Functions Decl]] - **μ°Έμ‘° λ§₯락:** ν•¨μˆ˜ μ„Ήμ…˜ 첫 챕터 β€” ν•¨μˆ˜ μ„ μ–Έκ³Ό μ •μ˜(Functions Decl) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C Functions β€” https://www.w3schools.com/c/c_functions.php ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C Functions" page (Astra wiki-curation, P-Reinforce v3.1 format).