Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:45:55+00:00 2026-05-23T15:45:55+00:00

I have a vector that is empty, something is filling it somewhere and I

  • 0

I have a vector that is empty, something is filling it somewhere and I cant find it. I want to set a memory breakpoint so that when the push_back occurs the program will break.

I’m using Visual Studio 2008, and the problem is that the vector doesnt display its internal members in the watch window (it seems to have a custom formatting). It just looks like this:

myVector[0]() std::vector< int,std::allocator< int > >

Indicating size 0. Any tips?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:45:56+00:00Added an answer on May 23, 2026 at 3:45 pm

    This answer is for VS 2010 – details might differ in other versions.

    Since the debugger uses a data visualizer (or whatever it’s called) to display the state of a std::vector, you have to look in the <vector> header to determine the names of the actual members of the class and which one(s) might be responsible for tracking the number of elements. An easy way to do this is to step through a call to vector::push_back().

    In VC++ 2010 this is a member pointer named _Mylast.

    So all you have to do is set a data breakpoint on writes to &v._Mylast (where v is the vector you are interested in debugging).

    The next time an element is added, the debugger will break with a call stack showing exactly where.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vector that I want to insert into a set . This
I have a vector X that contains positive numbers that I want to bin/discretize.
I have a vector of beans that holds information I want to display in
I have a std::vector. I want to create iterators representing a slice of that
I have a Vector that holds a number of objects. My code uses a
I have a vector-like class that contains an array of objects of type T
I have a sparsely populated vector that I populated via hashing, so elements are
I have a vector declared as a global variable that I need to be
Let's assume that we have a vector like x = -1:0.05:1; ids = randperm(length(x));
I have created a BST full of WordInfo objects that have a vector to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.