가장 많이 묻는 면접 질문과 답변 & 온라인 테스트
면접 준비, 온라인 테스트, 튜토리얼, 라이브 연습을 위한 학습 플랫폼

집중 학습 경로, 모의고사, 면접 준비 콘텐츠로 실력을 키우세요.

WithoutBook은 주제별 면접 질문, 온라인 연습 테스트, 튜토리얼, 비교 가이드를 하나의 반응형 학습 공간으로 제공합니다.

Chapter 5

Functions, Recursion, Scope, and Storage Classes

Write modular C programs using functions, understand parameter passing, recursion, and how storage duration and scope affect variable behavior.

Inside this chapter

  1. Why Functions Matter
  2. Function Declaration and Definition
  3. Call by Value and Addresses
  4. Recursion
  5. Scope and Storage Classes
  6. Real-World Usage Snapshot

Series navigation

Study the chapters in order for the clearest path from C basics to advanced memory, systems, debugging, and real-world development practice. Use the navigation at the bottom of each page to move smoothly through the full tutorial.

Tutorial Home

Chapter 5

Why Functions Matter

Functions make programs modular, reusable, testable, and easier to understand. Good C programs avoid putting all logic in main. Instead, they divide responsibilities into clear units.

Chapter 5

Function Declaration and Definition

#include <stdio.h>

int add(int a, int b);

int main(void) {
    printf("%d\n", add(2, 3));
    return 0;
}

int add(int a, int b) {
    return a + b;
}

The declaration tells the compiler about the function before use. This becomes especially important in multi-file programs.

Chapter 5

Call by Value and Addresses

C passes arguments by value. If you want a function to modify a caller variable, you typically pass its address through a pointer.

void increment(int *value) {
    (*value)++;
}
Chapter 5

Recursion

int factorial(int n) {
    if (n <= 1) {
        return 1;
    }
    return n * factorial(n - 1);
}

Recursion is elegant for some problems, but students must understand base cases and stack usage carefully.

Chapter 5

Scope and Storage Classes

Keyword Idea
autoDefault local storage duration
staticPersistent lifetime, limited scope depending on placement
externReference to a global defined elsewhere
registerHistorical hint for fast storage, mostly advisory
Chapter 5

Real-World Usage Snapshot

Functions and storage rules matter in every serious C codebase. Embedded firmware, networking utilities, database internals, and command-line tools all rely on carefully designed modular functions and predictable variable lifetime.

Copyright © 2026, WithoutBook.