Files
2nd/10_Wiki/Topics/Topic_Programming/Topic_CSharp/CSharp_Variables.md
T
Antigravity Agent 9a135bd19d docs(10_Wiki): Topic_Business/General/Graphic/Programming을 Topics/ 하위로 이동
최상위 10_Wiki/Topic_*였던 4개 카테고리 폴더를 10_Wiki/Topics/Topic_* 로 재배치.
콘텐츠 변경 없음(순수 폴더 이동) — Topics/ 하위 나머지 폴더는 이미 지난 커밋에서
전부 정리된 상태(잔존 항목은 에이전트 운영 상태 및 사용자가 보존을 요청한
업데이트0615/무제 3.canvas 뿐).
2026-07-05 00:44:01 +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 C# Variables Programming_Language draft conceptual
int double char string bool
C# 변수
B 0.85 2026-07-04 2026-07-04
csharp
programming-language
w3schools
variables
https://www.w3schools.com/cs/cs_variables.php

CSharp Variables

🎯 한 줄 통찰 (One-line insight)

C#'s five introductory types (int/double/char/string/bool) match Java's primitive-plus-String lineup almost exactly, but string in C# is a genuine built-in keyword-level type from the very first variable chapter — no separate library import, no <string> header, no std::string namespace qualifier — collapsing what took C an entire "no native strings" caveat and C++ a dedicated Strings section (<string> header, std::string vs C-style char arrays) into a single bullet point alongside int/double/char/bool. [S1]

🧠 핵심 개념 (Core concepts)

  • int — whole numbers without decimals (e.g. 123, -123). [S1]
  • double — floating-point numbers with decimals (e.g. 19.99, -19.99). [S1]
  • char — a single character, surrounded by SINGLE quotes ('a'). [S1]
  • string — text, surrounded by DOUBLE quotes ("Hello World") — a first-class type from the start, not a library add-on. [S1]
  • bool — two states only: true or false. [S1]
  • Declaration syntaxtype variableName = value;; can also declare without initializing, then assign later (int myNum; myNum = 15;). [S1]
  • Reassignment overwrites — assigning a new value to an existing variable replaces the old one silently (no warning). [S1]

📖 세부 내용 (Details)

  • String declaration + print: string name = "John"; Console.WriteLine(name);. [S1]
  • Int declaration + print: int myNum = 15; Console.WriteLine(myNum);. [S1]
  • Declare-then-assign: int myNum; myNum = 15; Console.WriteLine(myNum);. [S1]
  • Overwrite: int myNum = 15; myNum = 20; // myNum is now 20. [S1]
  • All five types declared together: int myNum = 5; double myDoubleNum = 5.99D; char myLetter = 'D'; bool myBool = true; string myText = "Hello"; — note the D suffix on the double literal. [S1]

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

  • string이 처음부터 내장 타입으로 취급됨: C는 문자열이라는 내장 타입 자체가 없어 char 배열로 흉내내야 했고, C++는 <string> 헤더와 std::string을 별도로 배워야 했지만, C#은 첫 변수 챕터부터 int/double/char/bool과 동일한 급으로 string을 나열한다는 점이 확인됨 — 별도 import나 네임스페이스 한정자 없이 바로 사용 가능. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — name(string)과 myNum(int) 변수를 선언하고 출력하는 기본 예제가 원문에서 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Declaring all five basic C# types (C#):

int myNum = 5;
double myDoubleNum = 5.99D;
char myLetter = 'D';
bool myBool = true;
string myText = "Hello";

검증 상태 및 신뢰도

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

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

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