--- id: cpp-output title: "C++ Output (Print Text)" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["cout insertion operator", "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: ["cpp", "programming-language", "w3schools", "output", "cout"] raw_sources: ["https://www.w3schools.com/cpp/cpp_output.asp"] applied_in: [] github_commit: "" --- # [[CPP Output (Print Text)]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `cout` never inserts a newline automatically β€” exactly the same behavior as C's `printf()` β€” meaning C++'s I/O model, despite replacing `printf()` with an object-and-operator syntax (`cout <<`), preserves the identical "no automatic line breaks" limitation, so multiple `cout` calls still concatenate onto one line unless the programmer explicitly adds a newline character. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`cout` + `<<`** β€” the object and insertion operator used to print text; text must be wrapped in double quotes. [S1] - **No automatic newline** β€” multiple `cout` statements concatenate output onto ONE line, just like C's `printf()`. [S1] - **Multiple `cout` calls allowed** β€” as many as needed in one program. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Basic print: `cout << "Hello World!";`. [S1] - Newline-less concatenation across two calls: `cout << "Hello World!"; cout << "I am learning C++"; // both render on one line`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) - **cout도 printf()처럼 μ€„λ°”κΏˆμ„ μžλ™ μ‚½μž…ν•˜μ§€ μ•ŠμŒ**: μ—¬λŸ¬ cout 호좜 κ²°κ³Όκ°€ λͺ¨λ‘ ν•œ 쀄에 이어져 좜λ ₯λœλ‹€λŠ” 점이 C의 printf() λ™μž‘κ³Ό 동일함이 확인됨. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” λ‹€μŒ 챕터(New Lines)μ—μ„œ \nκ³Ό endl둜 μ€„λ°”κΏˆμ„ λͺ…μ‹œμ μœΌλ‘œ μΆ”κ°€ν•˜λŠ” λ°©λ²•μœΌλ‘œ 이어진닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Two cout calls concatenating onto one line with no automatic newline (C++): ```cpp #include using namespace std; int main() { cout << "Hello World!"; cout << "I am learning C++"; return 0; } ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.84 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[C++ Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[CPP Comments]], [[CPP Output Numbers]], [[CPP New Lines]] - **μ°Έμ‘° λ§₯락:** ν…μŠ€νŠΈ 좜λ ₯ β€” 숫자 좜λ ₯(Output Numbers) μ±•ν„°λ‘œ 이어짐. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” C++ Output (Print Text) β€” https://www.w3schools.com/cpp/cpp_output.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C++ Output (Print Text)" page (Astra wiki-curation, P-Reinforce v3.1 format).