refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
---
|
||||
id: c-strings
|
||||
title: "C Strings"
|
||||
category: "Programming_Language"
|
||||
status: "draft"
|
||||
verification_status: "conceptual"
|
||||
canonical_id: ""
|
||||
aliases: ["char array", "null terminator", "C 문자열"]
|
||||
duplicate_of: ""
|
||||
source_trust_level: "B"
|
||||
confidence_score: 0.87
|
||||
created_at: 2026-07-04
|
||||
updated_at: 2026-07-04
|
||||
review_reason: ""
|
||||
merge_history: []
|
||||
tags: ["c", "programming-language", "w3schools", "strings"]
|
||||
raw_sources: ["https://www.w3schools.com/c/c_strings.php"]
|
||||
applied_in: []
|
||||
github_commit: ""
|
||||
---
|
||||
|
||||
# [[C Strings]]
|
||||
|
||||
## 🎯 한 줄 통찰 (One-line insight)
|
||||
C has no true `String` type at all — a string is just an array of `char`s ending in a special `\0` null-terminator character, proven directly by the fact that `sizeof()` reports the SAME size (13 bytes) whether the string was written as a convenient literal (`"Hello World!"`) or manually spelled out character-by-character with an explicit `\0` at the end (`{'H','e',...,'!','\0'}`) — the literal syntax is pure convenience, not a different underlying type. [S1]
|
||||
|
||||
## 🧠 핵심 개념 (Core concepts)
|
||||
- **No dedicated String type** — a C "string" is a `char` array; `char greetings[] = "Hello World!";` is the idiomatic way to create one. [S1]
|
||||
- **`%s` format specifier** — used to print an entire string (as opposed to `%c` for a single character). [S1]
|
||||
- **Index access** — since a string is an array, `greetings[0]` accesses its first character, printed with `%c`. [S1]
|
||||
- **Mutable characters** — individual characters can be reassigned via index (`greetings[0] = 'J';`), changing the string in place. [S1]
|
||||
- **Null terminator (`\0`)** — required at the end of a manually-built character-list string; string literals get it added automatically. [S1]
|
||||
- **Loop-through pattern** — iterating a string's characters via a `for` loop, ideally using `sizeof(arr)/sizeof(arr[0])` for the length instead of a hardcoded number. [S1]
|
||||
|
||||
## 📖 세부 내용 (Details)
|
||||
- Modifying a single character: `char greetings[] = "Hello World!"; greetings[0] = 'J'; printf("%s", greetings); // Outputs Jello World!`. [S1]
|
||||
- Manual character-list construction requiring an explicit null terminator: `char greetings[] = {'H','e','l','l','o',' ','W','o','r','l','d','!','\0'};`. [S1]
|
||||
- Proving both construction methods produce identically-sized arrays: `printf("%zu\n", sizeof(greetings)); // 13` and `printf("%zu\n", sizeof(greetings2)); // 13` (literal form auto-adds `\0`). [S1]
|
||||
|
||||
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
|
||||
- **문자열 리터럴과 수동 문자 나열의 동등성**: 두 방식 모두 결국 동일한 크기(13바이트, \0 포함)의 char 배열을 만든다는 점이 sizeof 비교로 직접 증명됨 — 리터럴은 단지 \0을 자동으로 추가해주는 편의 문법일 뿐. [S1]
|
||||
|
||||
## 🛠️ 적용 사례 (Applied in summary)
|
||||
인사말과 이름을 조합해 환영 메시지를 만드는 예제(`"%s %s!", message, fname`)가 원문에서 직접 실전 활용 사례로 제시됨. [S1]
|
||||
|
||||
## 💻 코드 패턴 (Code patterns)
|
||||
Looping through a string's characters using sizeof for a portable length calculation (C):
|
||||
```c
|
||||
char carName[] = "Volvo";
|
||||
int length = sizeof(carName) / sizeof(carName[0]);
|
||||
int i;
|
||||
for (i = 0; i < length; ++i) {
|
||||
printf("%c\n", carName[i]);
|
||||
}
|
||||
```
|
||||
|
||||
## ✅ 검증 상태 및 신뢰도
|
||||
- **상태:** draft
|
||||
- **검증 단계:** conceptual
|
||||
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
|
||||
- **신뢰 점수:** 0.87
|
||||
- **중복 검사 결과:** 신규 생성 (New discovery)
|
||||
|
||||
## 🔗 지식 그래프 (Knowledge Graph)
|
||||
- **상위/루트:** [[C Tutorial]]
|
||||
- **관련 개념:** [[C Operators Precedence]], [[C Arrays]], [[C Strings Esc]]
|
||||
- **참조 맥락:** 문자열 섹션 첫 챕터 — 특수문자/이스케이프(Strings Esc) 챕터로 이어짐.
|
||||
|
||||
## 📚 출처 (Sources)
|
||||
- [S1] W3Schools — C Strings — https://www.w3schools.com/c/c_strings.php
|
||||
|
||||
## 📝 변경 이력 (Change history)
|
||||
- 2026-07-04: Initial draft synthesized from the W3Schools "C Strings" page (Astra wiki-curation, P-Reinforce v3.1 format).
|
||||
Reference in New Issue
Block a user