Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / dbWriteFile == Not working very well

Author
Message
Zapleaf
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 11th Oct 2011 03:19 Edited at: 11th Oct 2011 03:29

This is what I have. Every time I do this I get weird results, the file will get written to, but I do not get the correct information stored. I tested it with other things, and found it to be random chaos. 7 = m, and m = 7.

Fixed after a quick search...
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 11th Oct 2011 18:53 Edited at: 11th Oct 2011 18:56
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:


you should use sprintf_s (or sprintf), it's safer, and can do much more

Login to post a reply

Server time is: 2024-04-26 23:51:19
Your offset time is: 2024-04-26 23:51:19