Unable to see memory location of vector in watch window in VS 2008

This is a discussion on Unable to see memory location of vector in watch window in VS 2008 within the C++ Programming forums, part of the General Programming Boards category; Hello, I just wrote a couple lines of code to see how the memory of vector variable is and I ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    37

    Unable to see memory location of vector in watch window in VS 2008

    Hello,
    I just wrote a couple lines of code to see how the memory of vector variable is and I cant seems to make it show in the watch window.
    Code:
    	vector<BYTE> buf;
    	buf.push_back('b');
    	buf.push_back('1');
    	buf.push_back('2');
    	buf.push_back('3');
    	vector<BYTE> * bufPtr = &buf;
    I tried to put both bufPtr and &buf in the watch window and non of them shows me the real pointer to the memory location.
    Thanks for any help

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    Code:
    &buf[0]
    should get what you want.
    If you intend to use it in a program, you'd be, generally, better off, with a vector<BYTE>::iterator .
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    37
    This is not what I wanted.
    I don't want pointer to the allocation it does to store the data.
    I want a pointer to the actual vector structs in the memory, where it keeps all its members and etc'
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. location window
    By sgh in forum C# Programming
    Replies: 1
    Last Post: 05-01-2009, 12:31 AM
  2. No Input window for cin>> For Express 2008
    By surefall in forum C++ Programming
    Replies: 0
    Last Post: 04-21-2009, 12:55 PM
  3. Console window in VC 2008
    By swgh in forum Tech Board
    Replies: 0
    Last Post: 06-05-2008, 04:13 PM
  4. Window location
    By exle in forum Windows Programming
    Replies: 2
    Last Post: 11-30-2003, 07:39 AM
  5. Dialog Window Initial Location :: MFC
    By kuphryn in forum C++ Programming
    Replies: 1
    Last Post: 04-06-2002, 10:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21