Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C++ vector

  1. May 11, 2005 #1
    How can i read file data into 2d vector ?thanks
  2. jcsd
  3. May 11, 2005 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    What kind of "vector?" A standard template library vector<?>, or what?

    - Warren
  4. May 11, 2005 #3
    uh you gotta create a vector or 2D memory allocation if your not using the STL-vector that chroot mentioned. Heh nice name chroot->>>BOO LINUX :rofl:
  5. May 12, 2005 #4
    It also matters what this file contains (chars, ints, doubles, strings, ...), how it is formatted, and how much data it contains. For instance on a typical desktop PC you will not be able to read more than 2GB of ints into memory at once altough you will be able to hold the file on disk just fine.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook