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

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

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

Chapter 4

Arrays, Strings, Pointers, References, and Memory Basics

Understand fundamental memory-related concepts in C++ including arrays, C-style strings, std::string, pointers, references, and basic allocation thinking.

Inside this chapter

  1. Arrays and std::array Thinking
  2. Strings
  3. Pointers and Addresses
  4. References Versus Pointers
  5. Dynamic Memory Basics
  6. Real-World Usage Snapshot

Series navigation

Study the chapters in order for the clearest path from C++ basics to modern ownership, templates, concurrency, performance, and production-ready engineering practices. Use the navigation at the bottom to move smoothly through the full series.

Tutorial Home

Chapter 4

Arrays and std::array Thinking

int numbers[5] = {10, 20, 30, 40, 50};
std::cout << numbers[0] << '\n';

Raw arrays still exist in C++, but modern C++ often prefers safer abstractions such as std::array or std::vector when possible.

Chapter 4

Strings

#include <string>

std::string name = "Alice";
std::cout << name.size() << '\n';

C++ supports both C-style strings and std::string. Beginners should prioritize std::string for safety and clarity, while still understanding C-style strings for interoperability and legacy code.

Chapter 4

Pointers and Addresses

int x = 10;
int *ptr = &x;
std::cout << *ptr << '\n';

Pointers are powerful and sometimes necessary, but they must be used carefully. C++ offers higher-level alternatives in many situations, yet pointer literacy remains essential.

Chapter 4

References Versus Pointers

Feature Reference Pointer
Can be nullNoYes
ReassignableNoYes
SyntaxSimplerMore explicit
Chapter 4

Dynamic Memory Basics

C++ supports dynamic memory through new and delete, but modern C++ often prefers smart pointers and containers instead of manual memory management wherever possible.

Chapter 4

Real-World Usage Snapshot

Understanding memory basics is critical for containers, custom data structures, APIs, performance analysis, and debugging. Even when higher-level abstractions are used, they are built on these ideas.

Copyright © 2026, WithoutBook.