Original Post
Alright, this is REALLY pissing me off...
Please tell me why this creates errors:
==================
My (soon-to-be) Cherished Cookie of Appreciation:
-- MattB - for WinSock advice --
//
// int2hex takes a LONG and converts it to hex in ASCII
//
// mqarc - an archive
// mqarc.files - a vector with the members:
// start, end, name
//
//
char* buf;
buf = new char [6];
for(i = 0; i != mqarc.files.size(); i++)
{
// Get file size
fbuf.open(mqarc.files[i].name);
fbuf.seekg(0,ios::end); // Get position of last char (total length)
// Enter vars....
mqarc.files[i].start = last + 1;
mqarc.files[i].end = mqarc.files[i].start + fbuf.tellg();
last = mqarc.files[i].end;
fbuf.close();
// Write vars....
fout << mqarc.files[i].name << endl;
// Convert the decimal-length to a hex-length in ASCII and write
strcpy(buf,int2hex(mqarc.files[i].start));
fout << buf << endl;
strcpy(buf,int2hex(mqarc.files[i].end));
fout << buf << endl;
};
delete[] buf;