docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화

Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
This commit is contained in:
Antigravity Agent
2026-07-05 00:10:59 +09:00
parent a397bc4720
commit 1cfd3bbb56
1495 changed files with 68534 additions and 27 deletions
@@ -0,0 +1,75 @@
---
id: csharp-arrays-loop
title: "C# Loop Through Arrays"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["for loop array C#", "foreach array C#", "C# 배열 순회"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.82
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["csharp", "programming-language", "w3schools", "arrays", "loops"]
raw_sources: ["https://www.w3schools.com/cs/cs_arrays_loop.php"]
applied_in: []
github_commit: ""
---
# [[CSharp Arrays Loop]]
## 🎯 한 줄 통찰 (One-line insight)
This chapter directly recycles the exact `foreach` example already shown in the Loops section's Foreach chapter — same `cars` array, same code — but now frames it explicitly AGAINST the indexed `for` loop alternative, making an explicit value judgment the earlier chapter didn't state outright: `foreach` is "easier to write... does not require a counter... more readable," a direct trade-off statement this wiki hasn't seen phrased this bluntly for C or C++'s equivalent range-based loops. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Indexed `for` loop over an array** — uses `.Length` as the loop bound: `for (int i = 0; i < cars.Length; i++) { Console.WriteLine(cars[i]); }`. [S1]
- **`foreach` loop over an array** — no counter, no `.Length`, no index: `foreach (string i in cars) { Console.WriteLine(i); }`. [S1]
- **Explicit trade-off stated** — `foreach` is easier to write, doesn't need a counter, and is more readable than the indexed `for` — a direct recommendation, not just a neutral alternative. [S1]
## 📖 세부 내용 (Details)
- Indexed loop: `string[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; for (int i = 0; i < cars.Length; i++) { Console.WriteLine(cars[i]); }`. [S1]
- Foreach loop (identical to the earlier Foreach Loop chapter's own example): `string[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; foreach (string i in cars) { Console.WriteLine(i); }`. [S1]
- Reading aid: "for each string element (called i — as in index) in cars, print out the value of i." [S1]
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **foreach가 for보다 명시적으로 권장됨**: 이전 Foreach Loop 챕터는 foreach를 단순히 소개만 했지만, 이번 챕터는 for와 나란히 비교하며 "카운터가 필요 없고 더 읽기 쉽다"고 명시적으로 우위를 선언한다는 점이 확인됨 — 두 방식이 동등한 대안이 아니라 foreach가 권장되는 선택임을 분명히 함. [S1]
## 🛠️ 적용 사례 (Applied in summary)
동일한 자동차 이름 배열을 인덱스 기반 for 루프와 foreach 루프 두 가지로 순회해 비교하는 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]
## 💻 코드 패턴 (Code patterns)
Indexed for loop vs. foreach — same output, different readability (C#):
```csharp
string[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
for (int i = 0; i < cars.Length; i++)
{
Console.WriteLine(cars[i]);
}
foreach (string i in cars)
{
Console.WriteLine(i);
}
```
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.82
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C# Tutorial]]
- **관련 개념:** [[CSharp Arrays]], [[CSharp Arrays Sort]], [[CSharp Foreach Loop]]
- **참조 맥락:** Arrays 섹션 — Sort Arrays 챕터로 이어짐.
## 📚 출처 (Sources)
- [S1] W3Schools — C# Loop Through Arrays — https://www.w3schools.com/cs/cs_arrays_loop.php
## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C# Loop Through Arrays" page (Astra wiki-curation, P-Reinforce v3.1 format).