---
id: c-variables-multiple
title: "C Declare Multiple Variables"
category: "Programming_Language"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["chained assignment", "comma-separated declaration", "C 여러 변수 선언"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.83
created_at: 2026-07-04
updated_at: 2026-07-04
review_reason: ""
merge_history: []
tags: ["c", "programming-language", "w3schools", "variables"]
raw_sources: ["https://www.w3schools.com/c/c_variables_multiple.php"]
applied_in: []
github_commit: ""
---

# [[C Declare Multiple Variables]]

## 🎯 한 줄 통찰 (One-line insight)
Both shortcuts covered here — comma-separated declaration (`int x = 5, y = 6, z = 50;`) and chained assignment (`x = y = z = 50;`) — REQUIRE all variables to share the exact same type, meaning these conveniences only apply within a single type declaration and cannot be used to initialize variables of different types in one statement. [S1]

## 🧠 핵심 개념 (Core concepts)
- **Comma-separated declaration** — `type a = v1, b = v2, c = v3;` declares and initializes multiple same-type variables in one statement. [S1]
- **Same-type restriction** — all variables in one comma-separated declaration must be of the SAME type; mixing types in one statement is not allowed. [S1]
- **Chained assignment** — `x = y = z = 50;` assigns the same value to multiple already-declared variables at once. [S1]
- **Readability tradeoff** — the source explicitly notes that declaring on one line is convenient, but separate lines are often easier to read. [S1]

## 📖 세부 내용 (Details)
- Comma-separated declaration with individual values: `int x = 5, y = 6, z = 50; printf("%d", x + y + z);`. [S1]
- Chained assignment of one shared value: `int x, y, z; x = y = z = 50; printf("%d", x + y + z);`. [S1]

## ⚖️ 모순 및 업데이트 (Contradictions & updates)
- 현재까지 발견된 모순 사항 없음 (No contradictions found in available sources).

## 🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — 여러 카운터 변수를 0으로 동시에 초기화하는 상황(x = y = z = 0)이 체이닝 대입의 대표 실전 활용이다. [S1]

## 💻 코드 패턴 (Code patterns)
Chained assignment giving multiple variables the same value at once (C):
```c
int x, y, z;
x = y = z = 50;
printf("%d", x + y + z);
```

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

## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[C Tutorial]]
- **관련 개념:** [[C Variables Change]], [[C Variables Format]]
- **참조 맥락:** 여러 변수 동시 선언 — 포맷 지정자(Variables Format) 챕터로 이어짐.

## 📚 출처 (Sources)
- [S1] W3Schools — C Declare Multiple Variables — https://www.w3schools.com/c/c_variables_multiple.php

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