--- id: c-statements title: "C Statements" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["semicolon", "C λͺ…λ Ήλ¬Έ"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.84 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["c", "programming-language", "w3schools", "statements"] raw_sources: ["https://www.w3schools.com/c/c_statements.php"] applied_in: [] github_commit: "" --- # [[C Statements]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Forgetting a single semicolon produces a compiler error that points to the WRONG line β€” the source's own example shows a missing `;` after one `printf()` call raising `error: expected ';' before 'return'`, meaning the compiler flags the token immediately AFTER the missing semicolon rather than the actual offending line, a common beginner confusion worth knowing in advance. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Statement** β€” one instruction in a C program; the building block of all C code. [S1] - **Mandatory semicolon termination** β€” every statement must end with `;`; omitting it causes a compile-time error. [S1] - **Sequential execution** β€” multiple statements in a program execute strictly in the order they are written, one at a time. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Single statement: `printf("Hello World!");`. [S1] - Missing-semicolon error demonstration: `printf("Hello World!")` (no trailing `;`) produces `error: expected ';' before 'return'` β€” the error references the NEXT statement, not the line actually missing the semicolon. [S1] - Sequential multi-statement execution: `printf("Hello World!"); printf("Have a good day!"); return 0;` β€” runs top to bottom, printing "Hello World!" then "Have a good day!" before ending. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **μ—λŸ¬ λ©”μ‹œμ§€μ˜ μœ„μΉ˜ μ˜€ν”„μ…‹**: μ„Έλ―Έμ½œλ‘ μ΄ λˆ„λ½λœ μ‹€μ œ 쀄이 μ•„λ‹ˆλΌ κ·Έ λ‹€μŒ 토큰(예: return)을 κΈ°μ€€μœΌλ‘œ μ—λŸ¬κ°€ λ³΄κ³ λœλ‹€λŠ” 점이 μ‹€μ „ 디버깅 μ‹œ ν˜Όλ™μ„ μΌμœΌν‚¬ 수 μžˆλ‹€κ³  경고됨. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” μ„Έλ―Έμ½œλ‘  λˆ„λ½ μ—λŸ¬μ˜ μœ„μΉ˜κ°€ μ‹€μ œ 원인과 λ‹€λ₯΄λ‹€λŠ” 점을 미리 μ•Œμ•„λ‘λ©΄ μ‹€μ „ 디버깅 μ‹œκ°„μ„ 단좕할 수 μžˆλ‹€. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Three statements executing sequentially in source order (C): ```c printf("Hello World!"); printf("Have a good day!"); return 0; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.84 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[C Syntax]], [[C Output]] - **μ°Έμ‘° λ§₯락:** λͺ…λ Ήλ¬Έκ³Ό μ„Έλ―Έμ½œλ‘  κ·œμΉ™ β€” 좜λ ₯(Output) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C Statements β€” https://www.w3schools.com/c/c_statements.php ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C Statements" page (Astra wiki-curation, P-Reinforce v3.1 format).