April 2020
Intermediate to advanced
412 pages
9h 58m
English
We will create a program that allocates an array of structures and check how the order of the fields affects memory consumption. Follow these steps to do so:
#include <iostream>enum class Category: uint8_t { file, directory, socket};struct ObjectMetadata1 { uint8_t access_flags; uint32_t size; uint32_t owner_id; Category category;};
struct ObjectMetadata2 ...