Thread: Reading chunks from a file

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    29

    Question Reading chunks from a file

    I'm working on an editor (mostly to get hang of file/string handling) and I've run into this problem: When I read, say 20 bytes from a file using read(), and the file contains like 5 bytes, the remaining 15 bytes of the string comes of gibberish. Is there a way to get around this?

    Thanks.

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    29
    Hmm, works without the memset() call, whassit do?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  4. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM