--- id: c-comments title: "C Comments" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["single-line comments", "multi-line comments", "C 주석"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.85 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["c", "programming-language", "w3schools", "comments"] raw_sources: ["https://www.w3schools.com/c/c_comments.php"] applied_in: [] github_commit: "" --- # [[C Comments]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) Before C99 (1999), single-line `//` comments were NOT part of standard C at all β€” only `/* */` multi-line comments existed β€” meaning `//` comments, now the default choice for short notes, are actually a relatively recent addition to the language's ~50-year history, not an original feature. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **Single-line comments (`//`)** β€” everything from `//` to the end of the line is ignored by the compiler. [S1] - **Multi-line comments (`/* */`)** β€” everything between the markers is ignored, regardless of line count. [S1] - **Comments as code-disabling tool** β€” `//` can be prefixed to a line of working code to temporarily disable it during testing, without deleting it. [S1] - **Historical constraint** β€” pre-C99, only `/* */` was valid; `//` support was added in the C99 standard. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Single-line comment before code: `// This is a comment` followed by `printf("Hello World!");`. [S1] - Single-line comment disabling code: `printf("This will run"); // printf("This will NOT run");`. [S1] - Multi-line comment: `/* The code below will print the words Hello World! to the screen, and it is amazing */ printf("Hello World!");`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **// μ£Όμ„μ˜ ν‘œμ€€ν™” μ‹œμ **: C99(1999) μ΄μ „μ—λŠ” 닀쀑 쀄 주석(/* */)만 μ‚¬μš© κ°€λŠ₯ν–ˆκ³ , ν•œ 쀄 주석(//)은 C99λΆ€ν„° ν‘œμ€€μ— ν¬ν•¨λ˜μ—ˆλ‹€λŠ” 역사적 사싀이 λͺ…μ‹œλ¨ β€” κ΅¬ν˜• 컴파일러/ν‘œμ€€ μ€€μˆ˜ μ½”λ“œ μž‘μ„± μ‹œ μœ μ˜ν•΄μ•Ό ν•  사항. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” νŠΉμ • μ½”λ“œ 쀄을 μ§€μš°μ§€ μ•Šκ³  // 둜 μž„μ‹œ λΉ„ν™œμ„±ν™”ν•˜λŠ” 것이 μ‹€μ „ 디버깅/ν…ŒμŠ€νŠΈμ—μ„œ ν”νžˆ μ“°μ΄λŠ” 기법이닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Temporarily disabling a line of code using a single-line comment instead of deleting it (C): ```c printf("This will run"); // printf("This will NOT run"); ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.85 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[C Output]], [[C Organize Code]] - **μ°Έμ‘° λ§₯락:** 주석 문법 β€” μ½”λ“œ 쑰직화(Organize Code) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C Comments β€” https://www.w3schools.com/c/c_comments.php ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C Comments" page (Astra wiki-curation, P-Reinforce v3.1 format).