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

  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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    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 .

  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: 04-30-2009, 11:31 PM
  2. No Input window for cin>> For Express 2008
    By surefall in forum C++ Programming
    Replies: 0
    Last Post: 04-21-2009, 11:55 AM
  3. Console window in VC 2008
    By swgh in forum Tech Board
    Replies: 0
    Last Post: 06-05-2008, 03: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