Thread: the way data item is stored in container?

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    1

    the way data item is stored in container?

    hi,
    i just want to know that data items are stored in container classes, like vector, map and etc. , by reference or by value.

    thanks in advance.

    khurram

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Neither would be the best answer. Vectors, for example, store a stack. The data that you used is passed back to you is reference to an entry in that stack.

  3. #3
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    I was wondering the same thing that khurram was wondering. So is the whole object placed on the stack or just a pointer to the object? I tend to place whole objects in containers and if the whole thing is sent then maybe I should be storing pointers instead

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  2. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  3. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  4. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  5. Dynamic list of Objects in External File
    By TechWins in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2002, 02:05 PM