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. Graphics
  4. reading vectors values of type static from file

reading vectors values of type static from file

Scheduled Pinned Locked Moved Graphics
c++graphicsgame-devquestion
5 Posts 2 Posters 5 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.
  • M Offline
    M Offline
    Miss_ Petrovna
    wrote on last edited by
    #1

    hii... i'd like to ask if someone know how can i read 3 DIM vectors valuse of (static type) from file(any external file on any drive of PC) using C++.. my application is programmed by C++ with OpenGL. regards miss maria

    E 1 Reply Last reply
    0
    • M Miss_ Petrovna

      hii... i'd like to ask if someone know how can i read 3 DIM vectors valuse of (static type) from file(any external file on any drive of PC) using C++.. my application is programmed by C++ with OpenGL. regards miss maria

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #2

      Miss_ Petrovna wrote:

      how can i read 3 DIM vectors valuse of (static type) from file

      how are the vectors defined... generally I have a vector < some3dstructure > storage. and then I simply read into some3dstructure and then push_back(some3dstructure) into the vector. This makes it real easy to read/write binary data. Text data is not really a little more difficult, but rather just a few more steps to keep track of and get right. -- modified at 18:22 Monday 23rd July, 2007

      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

      M 1 Reply Last reply
      0
      • E El Corazon

        Miss_ Petrovna wrote:

        how can i read 3 DIM vectors valuse of (static type) from file

        how are the vectors defined... generally I have a vector < some3dstructure > storage. and then I simply read into some3dstructure and then push_back(some3dstructure) into the vector. This makes it real easy to read/write binary data. Text data is not really a little more difficult, but rather just a few more steps to keep track of and get right. -- modified at 18:22 Monday 23rd July, 2007

        _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

        M Offline
        M Offline
        Miss_ Petrovna
        wrote on last edited by
        #3

        Thankx El Corazon for Ur perfect opinion. i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly (this what i did in my program).Ur opinion is very nice from phelosophical view too :) . regards maria -- modified at 5:51 Friday 27th July, 2007

        E 1 Reply Last reply
        0
        • M Miss_ Petrovna

          Thankx El Corazon for Ur perfect opinion. i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly (this what i did in my program).Ur opinion is very nice from phelosophical view too :) . regards maria -- modified at 5:51 Friday 27th July, 2007

          E Offline
          E Offline
          El Corazon
          wrote on last edited by
          #4

          Miss_ Petrovna wrote:

          i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly

          they are not that much different. A routine for processing the vector information can in its simplest form be binary read/write. With minor changes you can use routines to provide an interface to/from the binary form to XML, or other text formats, or any format for that matter. They all have generally the same inforamtion, they simply put it in different forms or locations within the file.

          _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

          M 1 Reply Last reply
          0
          • E El Corazon

            Miss_ Petrovna wrote:

            i was looking for efficient way to read static info. from a file for program generality instead of reading binary data directly

            they are not that much different. A routine for processing the vector information can in its simplest form be binary read/write. With minor changes you can use routines to provide an interface to/from the binary form to XML, or other text formats, or any format for that matter. They all have generally the same inforamtion, they simply put it in different forms or locations within the file.

            _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

            M Offline
            M Offline
            Miss_ Petrovna
            wrote on last edited by
            #5

            thank U again El Corazon for UR rich information about my question.. frankly, i'll avoid the complexity and errors which may be accured when data r read from file. both of UR opinions are satisfactory and perfect.. I have built my program upon UR first opinion, i'll keep UR second perfect suggestion for future work :). regards maria -- modified at 14:42 Sunday 29th July, 2007

            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