CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Apr 2009
    Posts
    3

    help writing binary(?) data to a file please (Problem Resolved)

    Hi everyone. I'm trying to write data to a file and having 2 problems. The data is integer data (0~255) and I've tried using the write & print commands and various conversions with no luck. I'm reading a byte of data at a time from a device, hence the 0~255. If I try writing this to a file I get the ascii characters written to the file, along with a CR & LF. For example, if I try to write '255' to the file and then look at it with a hex editor, I see five bytes written: "32 35 35 0D 0A". What I'd really like to see in the hex editor is "FF" and nothing else.


    Can someone help me with the proper conversion or method to write the straight binary data, and also supress the CR & LF?

    Thanks in advance!!! Oh, and Happy Easter!!!
    Last edited by mtnman82; April 12th, 2009 at 06:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured