mercredi 27 octobre 2021

Assigning an array with std::fgetc() return

I am trying to store the first 4 chars of a .awv file using the std::fgetc function

This is what I have

FILE* WAVF = fopen(FName, "rb");
std::vector<std::string> ID;
ID[4];
for (int i = 0; i < 4; i++)
{
    ID[i] = fgetc(WAVF);
}

I keep getting this error:

Exception thrown at 0x00007FF696431309 in ConsoleApplication3.exe: 
0xC0000005: Access violation writing location 0x0000000000000010.

Aucun commentaire:

Enregistrer un commentaire