TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MICHAEL HEID
from: DARIN MCBRIDE
date: 1997-08-08 08:28:00
subject: Editing SEG/OFF

 -=> Quoting Michael Heid to All
 MH> I am VERY new to C++ and am learing about editing files... anyways, I
 MH> was wondering if their was a way (when using: ofstring
 MH> output("c:\xx");) to edit hexidecimal offsets directly?
Use ofstream::write rather than the inserter operator (<<).
 MH> void main()
 MH> {
 MH> ofstream output("wdial.001")
 MH> output << "..n........j.@.......f.@";
 MH> }
 MH> -----------------------------
 MH> Notice the "." are all the 00
 MH> hex character.
Ah, but 00 is also the "nul" character that signifies the end of a string in
C/C++.  You don't want to write a string, which is what you're doing, but a
byte array - which is why you want to use write().
output.write(...); // I don't recall the params.. :-/
... I am Windoze of Borg.  Your disk space will be assimilated.
--- FastEcho 1.46
---------------
* Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.