Why is the size of struct Player is increased by 7 bytes?

Viewed 44

I want to know the reason of increasing the size of struct Player from 25 to 32 bytes. I know using #pragma pack(push,1) to strict padding and #pragma pack(pop) to release padding of struct but I want to know why even this behavior is occurred, what secrets are behind it?

#include <iostream>
#include <fstream>
using namespace std;

struct player
{
    char name [13];
    int age;
    double score;
};
int main()
{
    cout << sizeof(player) << '\n';
    return 0;
} 

OutPut: 32

0 Answers
Related