SDL2 events QUIT


I am new to C Lang and SDL development.

I am working on Windows 10, with Visual Studio 2019 and the SDL2 installed via vcpkg.

So I wanted to do a first test with a main.c which only displays a window and which waits for it to close by pressing the X button.

I therefore notice that the value of the event is in int 12. (via a printf in the console)

Here is my code:

#include <stdio.h>
#include <stdlib.h>

#include <SDL2/SDL.h>

int main(int argc, char* argv[])
    SDL_Window* screen = NULL;
    SDL_Event event;
    int continuer = 1;

    // Démarrage et chargement du système vidéo
    if (SDL_Init(SDL_INIT_VIDEO) == -1)
        fprintf(stderr, "Erreur au chargement de la lib SDL - %s!\n", SDL_GetError());
    screen = SDL_CreateWindow(
        "Ma fenêtre en SDL2",
    if (screen == NULL) {
        fprintf(stderr, "Screen is not created - %s\n", SDL_GetError());

    while (continuer)
        printf("%d\n", event.type);
        switch (event.type)
        case SDL_QUIT:
            continuer = 0;


    return EXIT_SUCCESS;

But when I look at the value of the enumerated for SDL_QUIT it is equal to 0x100 in hex or 256 in int.

This image comes from the SDL_events.h file

So I would like to know if the value comes from a fault in my configuration or have I misunderstood something?

Thank you

It was 12, in SDL 1.2. I’m not sure how this managed to compile or run if you ended up with an SDL 1.2 library or headers when you expected SDL2.