O'Reilly logo

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

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required