guess this is not the correct board
anyhow, i prefer the first method, it's right, not wrong:
you are writing raw data, so it's 4 bytes for int, but if your integer is like 1234567, you have 7 digits there, so you will store 7 bytes, 4 is better eh? plus you can make them 2 per int if you're not going to use large numbers for position, difference might not seem big, but more positions stored = more useless bytes, and one more thing: readable text = editable text, what does this mean? anyone can open up the file and re-write it, but if they were raw bytes, he would have harder time doing so, and will probably quit bothering with it
also, your fixed code is not quite fixed, you did not free the data, DONT USE dbStr, and if you really want to, do this:
int File(){
char* c = NULL;
c = dbStr(dbObjectPositionX(p));
if (dbFileExist("this.txt") == 0)
{
dbOpenToWrite(1, "this.txt");
dbWriteString(1, c);
dbCloseFile(1);
}
if ( c )
delete c; //<---
}
you should use sprintf_s (or sprintf), it's safer, and can do much more