Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. quick watching vector variable

quick watching vector variable

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdebugging
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 9 Offline
    9 Offline
    9ine
    wrote on last edited by
    #1

    how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible

    9ine

    N 1 Reply Last reply
    0
    • 9 9ine

      how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible

      9ine

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      9ine wrote:

      how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible

      It's quite easy. For eg: if you have an array like

      int *pnData = new int[20];

      // Fill out pData here Now select pnData and press Shift + F9 for quick watch window. This will only show you the first value. Now in order to see next value type the following...

      pnData[0] //--> Will show first element
      pnData[1] //--> Will show second element
      pnData[2] //--> Will show third element....

      Same with vector too... Select the variable that denotes the array in a vector, that is the internal data pointer in quick watch window. Now follow the same procedure that you did for pnData. Hope this helps...


      Nibu thomas A Developer Programming tips[^]  My site[^]

      K 1 Reply Last reply
      0
      • N Nibu babu thomas

        9ine wrote:

        how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible

        It's quite easy. For eg: if you have an array like

        int *pnData = new int[20];

        // Fill out pData here Now select pnData and press Shift + F9 for quick watch window. This will only show you the first value. Now in order to see next value type the following...

        pnData[0] //--> Will show first element
        pnData[1] //--> Will show second element
        pnData[2] //--> Will show third element....

        Same with vector too... Select the variable that denotes the array in a vector, that is the internal data pointer in quick watch window. Now follow the same procedure that you did for pnData. Hope this helps...


        Nibu thomas A Developer Programming tips[^]  My site[^]

        K Offline
        K Offline
        krmed
        wrote on last edited by
        #3

        Another option is in the watch window, use pnData,20 That will show 20 elements. Hope that helps.

        Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

        N 1 Reply Last reply
        0
        • K krmed

          Another option is in the watch window, use pnData,20 That will show 20 elements. Hope that helps.

          Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          krmed wrote:

          Another option is in the watch window, use pnData,20 That will show 20 elements.

          This is real nice. Thanks for this info. I didn't know about this. A 5. Do you know any more of such tricks. :)


          Nibu thomas A Developer Programming tips[^]  My site[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups