Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. fread() returning zero

fread() returning zero

Scheduled Pinned Locked Moved C / C++ / MFC
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hemlat
    wrote on last edited by
    #1

    Hi, I am reading a file using C into a buffer (structure). For 7 times I am reading it without error but when I try to read that 8th or 9th time it is reaidng the content into buffer but fread() is returning zero can anybody suggest me what mey be the reason. Thanks in advance, Regards, Hema.

    _ 1 Reply Last reply
    0
    • H hemlat

      Hi, I am reading a file using C into a buffer (structure). For 7 times I am reading it without error but when I try to read that 8th or 9th time it is reaidng the content into buffer but fread() is returning zero can anybody suggest me what mey be the reason. Thanks in advance, Regards, Hema.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You probably reached the end of the file. You are probably seeing the previous contents in the buffer when fread returns 0.

      «_Superman_» I love work. It gives me something to do between weekends.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups