Код: Выделить всё
struct A
{
int x;
char y;
};
int main()
{
std::vector v(sizeof(A), 0);
A* p = reinterpret_cast(v.data());
p->x = 1;
p->y = 'a';
std::cout x
Подробнее здесь: [url]https://stackoverflow.com/questions/79824305/when-is-reinterpret-cast-ub[/url]
Мобильная версия