In order to read a file in my code, I use std::filesystem::file_size (https://en.cppreference.com/w/cpp/filesystem/file_size) to get his size. I use this code :