reading & writing to a file
EDIT: just figured that out, so im gonna replace this with another question:
if i wanted to first read a file and then write into it, what should i put as mode[].. tried "wrt" but i couldnt read from it :? EDIT2: of yeah, and im talking about the new file natives :) |
oh come on!
i made a test script; it reads the file just fine but cant write anything into it Code:
or do i just need to first read, then close and open it again for writing? :? |
I guess you want r+t . Click here for more info.
On a side note, fprintf does formatting, so my best bet is this: Code:
Untested, but you get the idea. |
*-1 is there coz i need to back up, since the position is set to end of the line after fgets()
and i first did format it in fprintf(), but it produced a tag mismatch :) anyways, thanks for the link <3 |
| All times are GMT -4. The time now is 20:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.