--- id: c-pointer-to-pointer title: "C Pointer to Pointer" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["double pointer", "int**", "C 포인터의 포인터"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.86 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["c", "programming-language", "w3schools", "pointers", "double-pointer"] raw_sources: ["https://www.w3schools.com/c/c_pointer_to_pointer.php"] applied_in: [] github_commit: "" --- # [[C Pointer to Pointer]] ## 🎯 한 줄 통찰 (One-line insight) The source's own analogy nails the concept exactly: "a normal pointer is like a note with an address on it; a pointer to pointer is like another note telling you where that first note is kept" — meaning `**pptr` isn't some special new operation, it's just applying the SAME dereference (`*`) operator TWICE in a row, following one address to find a second address, then following that to find the actual value. [S1] ## 🧠 핵심 개념 (Core concepts) - **Pointer to pointer (double pointer, `int **pptr`)** — a pointer whose stored value is the ADDRESS OF ANOTHER POINTER, not a regular variable. [S1] - **One extra level of indirection** — `*ptr` gives a variable's value directly; `**pptr` gives the same value by following TWO addresses in sequence (pptr → ptr → myNum). [S1] - **Mutability through both levels** — assigning through `**pptr = 20;` changes the ORIGINAL variable (`myNum`), just as `*ptr = 20;` would. [S1] - **Use cases** — passing pointers into functions (so the function can modify what a pointer points to) and working with complex/nested data structures. [S1] ## 📖 세부 내용 (Details) - Declaring and reading through two levels: `int myNum = 10; int *ptr = &myNum; int **pptr = &ptr; printf("**pptr = %d\n", **pptr); // 10`. [S1] - Modifying the original variable through the double pointer: `int myNum = 5; int *ptr = &myNum; int **pptr = &ptr; **pptr = 20; printf("myNum = %d\n", myNum); // 20`. [S1] ## ⚖️ 모순 및 업데이트 (Contradictions & updates) - 현재까지 발견된 모순 사항 없음 (No contradictions found in available sources). ## 🛠️ 적용 사례 (Applied in summary) 현재 발견된 실제 적용 사례가 없습니다 — 함수에 포인터를 전달해 그 포인터 자체를 함수 안에서 바꿔야 할 때, 그리고 복잡한 자료구조를 다룰 때 포인터의 포인터가 유용하다고 원문에 명시됨. [S1] ## 💻 코드 패턴 (Code patterns) Modifying the original variable through two levels of pointer indirection (C): ```c int myNum = 5; int *ptr = &myNum; int **pptr = &ptr; **pptr = 20; // changes myNum printf("myNum = %d\n", myNum); // prints 20 ``` ## ✅ 검증 상태 및 신뢰도 - **상태:** draft - **검증 단계:** conceptual - **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body) - **신뢰 점수:** 0.86 - **중복 검사 결과:** 신규 생성 (New discovery) ## 🔗 지식 그래프 (Knowledge Graph) - **상위/루트:** [[C Tutorial]] - **관련 개념:** [[C Pointers Arrays]], [[C Memory Access]], [[C Functions Pointers]] - **참조 맥락:** 포인터의 포인터 — 동적 메모리 접근(Memory Access) 챕터로 이어짐. ## 📚 출처 (Sources) - [S1] W3Schools — C Pointer to Pointer — https://www.w3schools.com/c/c_pointer_to_pointer.php ## 📝 변경 이력 (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "C Pointer to Pointer" page (Astra wiki-curation, P-Reinforce v3.1 format).