--- id: cpp-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.83 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["cpp", "programming-language", "w3schools", "statements"] raw_sources: ["https://www.w3schools.com/cpp/cpp_statements.asp"] applied_in: [] github_commit: "" --- # [[CPP Statements]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Just as in C, a missing semicolon produces an error message pointing to the NEXT statement rather than the actual offending line (`error: expected ';' before 'return'`) β€” the identical error-location quirk from the C tutorial carries over unchanged to C++, confirming both languages share the same underlying parser behavior for this specific mistake. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Statement** β€” one instruction executed by the compiler; the basic building block of a C++ program. [S1] - **Mandatory semicolon termination** β€” every statement must end with `;`; omitting it causes a compile error. [S1] - **Sequential execution** β€” multiple statements execute strictly top-to-bottom, in written order. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Missing-semicolon error: `cout << "Hello World!"` (no `;`) β†’ `error: expected ';' before 'return'`. [S1] - Sequential multi-statement execution: `cout << "Hello World!"; cout << "Have a good day!"; return 0;` β€” runs top to bottom. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - ν˜„μž¬κΉŒμ§€ 발견된 λͺ¨μˆœ 사항 μ—†μŒ (No contradictions found in available sources). ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” C의 λ™μΌν•œ μ„Έλ―Έμ½œλ‘  κ·œμΉ™κ³Ό μ—λŸ¬ μœ„μΉ˜ νŠΉμ„±μ΄ κ·ΈλŒ€λ‘œ μ΄μ–΄μ§„λ‹€λŠ” 점이 C ν•™μŠ΅μžκ°€ C++둜 μ „ν™˜ν•  λ•Œ μœ λ¦¬ν•œ 지점이닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Three statements executing sequentially in source order (C++): ```cpp cout << "Hello World!"; cout << "Have a good day!"; return 0; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.83 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C++ Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CPP Syntax]], [[CPP Comments]] - **μ°Έμ‘° λ§₯락:** λͺ…λ Ήλ¬Έκ³Ό μ„Έλ―Έμ½œλ‘  κ·œμΉ™ β€” 주석(Comments) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C++ Statements β€” https://www.w3schools.com/cpp/cpp_statements.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C++ Statements" page (Astra wiki-curation, P-Reinforce v3.1 format).