Hi, i want to move the file pointer to the last 128th byte, so i can read the ID3V1 tag in an mp3 file. Here's my code to test the result of moving the file pointer:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("tagTest.mp 3");
char c;
fin.seekg(-128, ios_base::end);
cout << fin.eof()<< " " << hex << fin.tellg() << endl;
cin.get();
return 0;
}
and strangely, it always yields the result
0 0
i don't know why, i used seekg(-128, ios_base::end) and nothing happened! the file pointer still points to the beginning of the file. i tried using clear() function but it still doesn't work. Can someone pls help me with this problem? Thanks.
oh, by the way, i'm using Borland C++ Builder 6.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("tagTest.mp 3");
char c;
fin.seekg(-128, ios_base::end);
cout << fin.eof()<< " " << hex << fin.tellg() << endl;
cin.get();
return 0;
}
and strangely, it always yields the result
0 0
i don't know why, i used seekg(-128, ios_base::end) and nothing happened! the file pointer still points to the beginning of the file. i tried using clear() function but it still doesn't work. Can someone pls help me with this problem? Thanks.
oh, by the way, i'm using Borland C++ Builder 6.
Comment