CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    92

    Can anybody give me a way to see the address of elments stored in sdt::vector

    Hello, my respected gurus:

    I define a std::vector<double> a(100); and I want to see how this array are allocated in heap, I mean the address of each element of array a. For example , I want to see the address of a[10]
    How can I manage that!
    If u answer my question, I will surely give reputation to you untill i have no reputation! But i will try to get more reputation, and give it to you lately!

  2. #2
    Join Date
    May 2004
    Location
    Norway
    Posts
    655

    Re: Can anybody give me a way to see the address of elments stored in sdt::vector

    Take the address of it!
    Code:
    double* the_address = &a[10];
    Insert entertaining phrase here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured