Files
2nd/10_Wiki/Topic_Programming/Topic_CSharp/CSharp_Variables_Display.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +09:00

4.0 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
csharp-variables-display C# Display Variables Programming_Language draft conceptual
string concatenation C#
+ operator overload C#
C# 변수 출력
B 0.84 2026-07-04 2026-07-04
csharp
programming-language
w3schools
variables
concatenation
https://www.w3schools.com/cs/cs_variables_display.php

CSharp Display Variables

🎯 한 줄 통찰 (One-line insight)

C# overloads the SAME + operator to mean two entirely different operations depending on operand type — string concatenation ("Hello " + name) versus numeric addition (x + y) — with no separate concatenation operator like C++ chose to avoid (C++ ALSO overloads << for output but keeps + mostly numeric for its native strings, relying on std::string's own + overload); C# instead makes this dual-meaning + a first-class, chapter-one-visible feature, closer to Java's identical +-for-both-jobs design than to C++'s more type-segregated approach. [S1]

🧠 핵심 개념 (Core concepts)

  • + for string + text combination"Hello " + name concatenates a string literal and a string variable. [S1]
  • + for string + string combinationfirstName + lastName concatenates two string variables into a new string. [S1]
  • + for numeric addition — when both operands are numeric (e.g. int), + performs mathematical addition instead of concatenation. [S1]
  • Type determines behavior — the SAME operator symbol resolves to concatenation or addition purely based on the operand types involved. [S1]

📖 세부 내용 (Details)

  • String + variable: string name = "John"; Console.WriteLine("Hello " + name);. [S1]
  • Variable + variable (string): string firstName = "John "; string lastName = "Doe"; string fullName = firstName + lastName; Console.WriteLine(fullName);. [S1]
  • Numeric addition: int x = 5; int y = 6; Console.WriteLine(x + y); // Print the value of x + y → outputs 11. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • 동일 연산자가 타입에 따라 완전히 다른 동작을 함: +가 문자열이면 연결(concatenation), 숫자면 산술 덧셈이라는 이중 역할을 한다는 점이 이번 챕터에서 확인됨 — Java와 동일한 설계이며, C++가 std::string+ 연산자 오버로드를 통해 유사하게 동작하지만 C#은 이를 변수 출력 챕터 초반부터 명시적으로 강조한다는 차이가 있음. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — 이름 문자열을 인사말과 연결하고, 숫자 두 개를 더해 출력하는 두 예제가 원문에서 나란히 제시됨. [S1]

💻 코드 패턴 (Code patterns)

The + operator's dual meaning — concatenation vs. addition (C#):

string name = "John";
Console.WriteLine("Hello " + name);   // concatenation -> "Hello John"

int x = 5;
int y = 6;
Console.WriteLine(x + y);              // addition -> 11

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.84
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C# Display Variables" page (Astra wiki-curation, P-Reinforce v3.1 format).