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

C++ maps

  1. May 20, 2007 #1
    Hi, I'm wondering how to give a map a fixed size like you can give an array a fixed size by just "byte data[SIZE*DATASIZE]".. or if it's possible anybody know..

    struct Table {
    map<int, int> table; //

    struct Table *flightChart;

    The reason I have to give this a fixed size, is becuase I have to map this in shared memory :\, so that another process may access it, or is it possible to pass this structure to another process without shared memory :\
  2. jcsd
  3. May 20, 2007 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Even if it were fixed size, sharing your map object in shared memory might not accomplish what you want to do anyway. There's no guarantee that the map object store its data within a single contiguous block of memory -- it may store data in blocks all over the heap.

    - Warren
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook