---
id: c-data-types-characters
title: "C Character Data Types"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["char type", "ASCII values", "C 문자 타입"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.85
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["c", "programming-language", "w3schools", "data-types", "char", "ascii"]
raw_sources: ["https://www.w3schools.com/c/c_data_types_characters.php"]
applied_in: []
github_commit: ""
---

# [[C Character Data Types]]

## 🎯 한 줄 통찰 (One-line insight)
Assigning multiple characters to a single `char` variable (`char myText = 'Hello';`) doesn't raise an error — it silently prints only the LAST character — meaning `char`'s single-character limit is a silent-failure trap rather than a compile-time guard, and the source explicitly warns not to rely on it for anything beyond one character. [S1]

## 🧠 핵심 개념 (Core concepts)
- **`char`** — stores exactly one character, written in single quotes (`'A'`), printed with `%c`. [S1]
- **ASCII value assignment** — `char` variables can be assigned numeric ASCII codes directly (no quotes, since it's a number, not a literal character) and still print as the corresponding character via `%c`. [S1]
- **Silent truncation on multi-character assignment** — `char myText = 'Hello';` compiles but only stores/prints the LAST character, with no error raised. [S1]
- **Strings for multi-character text** — `char myText[] = "Hello";` (a character array, printed with `%s`) is the correct tool for multi-character text, not a bare `char`. [S1]

## 📖 세부 내용 (Details)
- Basic char: `char myGrade = 'A'; printf("%c", myGrade);`. [S1]
- ASCII numeric assignment: `char a = 65, b = 66, c = 67; printf("%c", a); printf("%c", b); printf("%c", c);` — prints A, B, C. [S1]
- The silent-truncation trap: `char myText = 'Hello'; printf("%c", myText);` — prints only the last character, with no compiler error. [S1]
- Correct multi-character storage: `char myText[] = "Hello"; printf("%s", myText);`. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **char에 여러 문자 대입 시 조용한 실패**: 'Hello'처럼 여러 문자를 char 변수에 대입해도 에러 없이 컴파일되지만 마지막 문자만 저장/출력된다는 점이 명시적으로 경고됨 — 여러 문자에는 반드시 문자열(char 배열)을 써야 함. [S1]

## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — ASCII 코드값(65,66,67)을 직접 char에 대입해 A/B/C를 출력하는 패턴이 문자와 숫자 표현이 내부적으로 같다는 것을 보여주는 실전 예시다. [S1]

## 💻 코드 패턴 (Code patterns)
Assigning ASCII numeric codes directly to char variables (C):
```c
char a = 65, b = 66, c = 67;
printf("%c", a);  // A
printf("%c", b);  // B
printf("%c", c);  // C
```

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

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C Tutorial]]
- **관련 개념:** [[C Data Types Numbers]], [[C Data Types Dec]], [[C Strings]]
- **참조 맥락:** 문자 타입과 ASCII — 소수점 정밀도(Data Types Dec) 챕터로 이어짐.

## 📚 출처 (Sources)
- [S1] W3Schools — C Character Data Types — https://www.w3schools.com/c/c_data_types_characters.php

## 📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C Character Data Types" page (Astra wiki-curation, P-Reinforce v3.1 format).
