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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. File read

File read

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
4 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.
  • K Offline
    K Offline
    Kash
    wrote on last edited by
    #1

    Hi, I am trying to read a binary file that has an array of n numbers from the hard disk. I want to store these numbers in an array then display in a Edit box. Any suggestions? kash

    N 1 Reply Last reply
    0
    • K Kash

      Hi, I am trying to read a binary file that has an array of n numbers from the hard disk. I want to store these numbers in an array then display in a Edit box. Any suggestions? kash

      N Offline
      N Offline
      Nitron
      wrote on last edited by
      #2

      Do you know the structure of the file? Is it a serialized CArray, or some other class? I usually just use an ifstream, and the >> operator. But then again, I know ahead of time what I'm looking for in the file... - Nitron


      "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

      K 1 Reply Last reply
      0
      • N Nitron

        Do you know the structure of the file? Is it a serialized CArray, or some other class? I usually just use an ifstream, and the >> operator. But then again, I know ahead of time what I'm looking for in the file... - Nitron


        "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

        K Offline
        K Offline
        Kash
        wrote on last edited by
        #3

        It's a 1 * n matrix (i.e. a column of number, size n) of varying precision generated by an external program to my MFC project. I guess I could find the size of the array by counting the elements. kash

        N 1 Reply Last reply
        0
        • K Kash

          It's a 1 * n matrix (i.e. a column of number, size n) of varying precision generated by an external program to my MFC project. I guess I could find the size of the array by counting the elements. kash

          N Offline
          N Offline
          Nitron
          wrote on last edited by
          #4

          if you have access to the output algorithm, that would certainly help. I know it would be a nightmare if I gave someone one of my binary files and said "here, read this", without knowing how I built it. :rolleyes: I guess the key question is if they are serializing the object as a whole, or simply exporting the data within the array. If it is the latter, you could use a std::vector and just pump the values back in. - Nitron


          "Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb

          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