Which is it for getting the position of formatex?
Which is correct?
new szMsg[512], pos = 0; Code:
or Code:
I changed 512-pos to 511-pos, which should it be? Thanks, Josh |
511
xor start with pos = 1 |
if you use 512 you could overflow your var and overwrite other memory and cause a fun crash. It really has nothing to do with "getting" the position. That arg is setting the max length to copy into the var. So if you start at pos 0 (which is correct) and the var is len 512 you should copy a max of 511 (511 - 0).
|
thanks guys, you'd think I'd know this being a 4th year comp. sci. eng. :P
|
| All times are GMT -4. The time now is 08:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.