---
id: cpp-data-types-string
title: "C++ String Data Types"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["string library", "not built-in type", "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: ["cpp", "programming-language", "w3schools", "data-types", "string"]
raw_sources: ["https://www.w3schools.com/cpp/cpp_data_types_string.asp"]
applied_in: []
github_commit: ""
---

# [[CPP String Data Types]]

## 🎯 한 줄 통찰 (One-line insight)
`string` is explicitly called out as "NOT a built-in type" despite behaving like one in basic usage — it requires including the `<string>` header before it can be used at all, meaning C++'s convenient string handling (versus C's raw `char` arrays) is a LIBRARY feature layered on top of the language, not a core language primitive like `int` or `char` are. [S1]

## 🧠 핵심 개념 (Core concepts)
- **`string`** — stores a sequence of characters (text); values surrounded by double quotes. [S1]
- **Not a built-in type** — requires `#include <string>` before use, unlike `int`/`char`/`bool`/`float`/`double` which need no such include. [S1]
- **"Behaves like" a built-in type** — in basic usage (declaration, assignment, printing), `string` feels indistinguishable from a native type despite technically being library-provided. [S1]

## 📖 세부 내용 (Details)
- Basic string declaration and printing (requires the header): `#include <string> string greeting = "Hello"; cout << greeting;`. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- **string은 내장 타입이 아님**: int/char/bool 등과 나란히 소개되지만, 실제로는 <string> 헤더를 포함해야 사용 가능한 라이브러리 제공 타입이라는 점이 명시적으로 구분됨. [S1]

## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — <string> 헤더 포함이 문자열을 다루는 모든 C++ 프로그램의 실전 필수 전제 조건이다. [S1]

## 💻 코드 패턴 (Code patterns)
Using the string type, which requires including the <string> header (C++):
```cpp
#include <string>
string greeting = "Hello";
cout << greeting;
```

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

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C++ Tutorial]]
- **관련 개념:** [[CPP Data Types Char]], [[CPP Data Types RealLife]], [[CPP Strings]]
- **참조 맥락:** 문자열 타입 — 데이터 타입 실전 예제(Data Types RealLife) 챕터로 이어짐, 문자열(Strings) 섹션과 직접 연결.

## 📚 출처 (Sources)
- [S1] W3Schools — C++ String Data Types — https://www.w3schools.com/cpp/cpp_data_types_string.asp

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