Skip to Content
Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions
book

Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions

by Herb Sutter
August 2004
Intermediate to advanced
352 pages
7h 38m
English
Addison-Wesley Professional
Content preview from Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions

Chapter 21. Containers in Memory, Part 2: How Big Is It Really?

Difficulty: 3

When you ask for memory, what do you really know about what you get—and what it will actually cost? How much memory do the standard containers use—in theory, in reality, and in the code you'll be writing this afternoon?

Solution

“I'll Take 'Operator New' for 200 Bytes, Alex”

  1. When you ask for n bytes of memory using new or malloc, do you actually use up n bytes of memory? Explain why or why not.

When you ask for n bytes of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions

Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions

Herb Sutter
Navigating C++ and Object-Oriented Design

Navigating C++ and Object-Oriented Design

Paul Anderson, Gail Anderson

Publisher Resources

ISBN: 0201760428Purchase book