e9cbf23ab5
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
4.5 KiB
4.5 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| c-functions-parameters | C Function Parameters | Programming_Language | draft | conceptual |
|
B | 0.87 | 2026-07-04 | 2026-07-04 |
|
|
C Function Parameters
🎯 한 줄 통찰 (One-line insight)
Passing an array to a function only requires the ARRAY NAME at the call site (myFunction(myNumbers)), but the function's own parameter declaration must still spell out the full array type (int myNumbers[5]) — an asymmetry that follows directly from the earlier Pointers-and-Arrays insight that an array name is already a pointer to its first element, so the "argument" being passed really is just that one address, while the parameter declaration exists purely to tell the function how to interpret what's at that address. [S1]
🧠 핵심 개념 (Core concepts)
- Parameter vs. argument — a parameter is the variable name INSIDE the function signature; an argument is the actual value passed at the CALL site (e.g.
nameis the parameter,"Liam"is the argument). [S1] - Multiple parameters — comma-separated in the signature; the call must supply the SAME NUMBER of arguments, IN THE SAME ORDER. [S1]
- Passing arrays — call site uses just the array name; the function signature still needs the full array declaration (
int myNumbers[5]). [S1] - Return values via a real return type — replacing
voidwith a type (e.g.int) plus areturnstatement lets the function hand back a computed value instead of just performing an action. [S1] - Storing results in arrays — when many result variables would otherwise be needed, storing each function call's result into an array element keeps the code manageable. [S1]
📖 세부 내용 (Details)
- Single string parameter reused across calls:
void myFunction(char name[]) { printf("Hello %s\n", name); } myFunction("Liam"); myFunction("Jenny");. [S1] - Passing an array (name-only at call site, full type in signature):
void myFunction(int myNumbers[5]) { for (int i = 0; i < 5; i++) { printf("%d\n", myNumbers[i]); } } int myNumbers[5] = {10,20,30,40,50}; myFunction(myNumbers);. [S1] - Returning a value instead of void:
int myFunction(int x, int y) { return x + y; } int result = myFunction(5, 3); // 8. [S1] - Storing multiple call results into an array:
resultArr[0] = calculateSum(5, 3); resultArr[1] = calculateSum(8, 2); .... [S1] - Real-life Fahrenheit-to-Celsius conversion:
float toCelsius(float fahrenheit) { return (5.0 / 9.0) * (fahrenheit - 32.0); }. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
- 인자 개수와 순서는 반드시 일치해야 함: 여러 매개변수를 사용할 때 함수 호출의 인자 개수가 매개변수 개수와 같아야 하고 순서도 동일해야 한다는 점이 명시적으로 강조됨. [S1]
🛠️ 적용 사례 (Applied in summary)
화씨를 섭씨로 변환하는 toCelsius() 함수가 원문에서 직접 실전 활용 사례로 제시됨. [S1]
💻 코드 패턴 (Code patterns)
A real-life function converting Fahrenheit to Celsius, returning a computed value (C):
float toCelsius(float fahrenheit) {
return (5.0 / 9.0) * (fahrenheit - 32.0);
}
int main() {
float f_value = 98.8;
float result = toCelsius(f_value);
printf("Convert Fahrenheit to Celsius: %.2f\n", result);
return 0;
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.87
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: C Tutorial
- 관련 개념: C Functions Decl, C Pointers Arrays, C Functions Recursion
- 참조 맥락: 함수 매개변수와 반환값 — 재귀(Functions Recursion) 챕터로 이어짐.
📚 출처 (Sources)
- [S1] W3Schools — C Function Parameters — https://www.w3schools.com/c/c_functions_parameters.php
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "C Function Parameters" page (Astra wiki-curation, P-Reinforce v3.1 format).