I did take the initializers out but this is leading to more issues.
Now the year is not working correctly (please see comments below). If i add the initializers it works again.
Code:
// new constructor
CMp3::CMp3() //:
//m_sSongName(30, '\0'),
//m_sArtist(30, '\0'),
//m_sAlbum(30, '\0'),
//m_sYear(4, '\0'),
//m_sComment(28, '\0'),
//m_sTrackNumber(2, '\0'),
//m_sGenreId(1, '\0'),
//m_sTrackNumber(1, '\0'),
//m_bHasATag(false)
{
}
std::ifstream is(sFilePath, std::ifstream::binary);
if (is)
{
int iHeaderLength = 128;
is.seekg(-iHeaderLength, is.end);
std::string sHeader(3, '\0');
// read header
is.read(&sHeader[0], 3);
if (sHeader == "TAG")
{
m_bHasATag = true;
std::string sTrackYN(1, '\0');
is.read(&m_sSongName[0], 30);
is.read(&m_sArtist[0], 30);
is.read(&m_sAlbum[0], 30);
is.read(&m_sYear[0], 4); // this has the year 2000iiiiiiiiiiii (16 characters long)
is.read(&m_sComment[0], 28); // this value is --> <Error reading characters of string.>
is.read(&sTrackYN[0], 1);
is.read(&m_sTrackNumber[0], 1);
is.read(&m_sGenreId[0], 1);
is.close();
............