Help with binary files

This is a discussion on Help with binary files within the C Programming forums, part of the General Programming Boards category; How do I create a code that can read binary files and copy what they say into a text file ...

  1. #1
    Linux User
    Join Date
    Nov 2005
    Location
    Bellingham, WA
    Posts
    35

    Help with binary files

    How do I create a code that can read binary files and copy what they say into a text file titled "out_file.txt". Needed for a program I am creating.

    NOTE: Thanks in advance for anyone who knows how to solve this problem!

  2. #2
    cwr
    cwr is offline
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    open the binary file(s) for reading
    open the text file for writing (using a text mode specifer)
    for each binary file, read it, write to the text file.

  3. #3
    Linux User
    Join Date
    Nov 2005
    Location
    Bellingham, WA
    Posts
    35

    Smile I've Tried that

    I have tried that technique but it did not work. I think I need to use the fread and fwrite functions according to the FAQ page. Although I am unsure how to use those functions and have failed in finding information on how to use them. Thank you!!

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You should befriend your local man page.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  2. send/recv binary files using sockets in C++
    By dafatdude in forum Networking/Device Communication
    Replies: 14
    Last Post: 07-25-2004, 12:00 PM
  3. MFC: CStrings & binary files question(s)
    By BrianK in forum Windows Programming
    Replies: 0
    Last Post: 06-24-2004, 06:41 PM
  4. Binary files
    By Brian in forum C Programming
    Replies: 2
    Last Post: 02-18-2002, 01:13 PM
  5. storing string objects to binary files
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-07-2001, 12:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21