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. how to watch the content which is pointed by a pointer

how to watch the content which is pointed by a pointer

Scheduled Pinned Locked Moved C / C++ / MFC
databasedebuggingperformancetutorialquestion
7 Posts 4 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.
  • W Offline
    W Offline
    wendyyue
    wrote on last edited by
    #1

    I am coding under vc 6.0 every time I debug, I find that if a list is pointed by the pointer, I can only see the first content of the list in the watch window, any ideas how to watch all the list ? PS. some say we can see them in a memory window but it is too hard to read. some say I can indicate the specific index of the list ,say list[5], but I want to see all the content in a list.

    T E 2 Replies Last reply
    0
    • W wendyyue

      I am coding under vc 6.0 every time I debug, I find that if a list is pointed by the pointer, I can only see the first content of the list in the watch window, any ideas how to watch all the list ? PS. some say we can see them in a memory window but it is too hard to read. some say I can indicate the specific index of the list ,say list[5], but I want to see all the content in a list.

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      a pointer is only an address in memory. if you handle an array, you actually use a pointer to the 1st element. the VC6 debugger is not very powerful (actually, VC6 itself is far outdated by its new versions). so if you want to see the other elements, you have to specify yourself the address of the element you need to watch AFAIK...

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      R 1 Reply Last reply
      0
      • W wendyyue

        I am coding under vc 6.0 every time I debug, I find that if a list is pointed by the pointer, I can only see the first content of the list in the watch window, any ideas how to watch all the list ? PS. some say we can see them in a memory window but it is too hard to read. some say I can indicate the specific index of the list ,say list[5], but I want to see all the content in a list.

        E Offline
        E Offline
        Ernest Laurentin
        wrote on last edited by
        #3

        I think in VC6, you can type something like: 'list,m' in the watch window This will show you the entire memory. VS2003, 2005, 2008 supports this.

        God bless, Ernest Laurentin

        W 1 Reply Last reply
        0
        • T toxcct

          a pointer is only an address in memory. if you handle an array, you actually use a pointer to the 1st element. the VC6 debugger is not very powerful (actually, VC6 itself is far outdated by its new versions). so if you want to see the other elements, you have to specify yourself the address of the element you need to watch AFAIK...

          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          R Offline
          R Offline
          Rajkumar R
          wrote on last edited by
          #4

          toxcct wrote:

          the VC6 debugger is not very powerful (actually, VC6 itself is far outdated by its new versions). so if you want to see the other elements, you have to specify yourself the address of the element you need to watch AFAIK...

          you are correct, But viewing the List items is very simple from VC6.0, we don't want to explicitly specify the address of the next element, it shows tree view in the watch window and expands the list if the first element is in the watch window.

          struct ListNode
          {
          int iData;
          struct ListNode *pNext;
          };

          int main(int argc, char* argv[])
          {

          struct ListNode Head, Middle, Tail;
          Head.pNext		= &Middle;
          Middle.pNext	= &Tail;
          Tail.pNext		= 0;
          
          return 0;
          

          }

          I can view the list items in the above program as tree view in the watch window of VC6.0, even VC6.0 supports drag and drop variable to watch window.

          T 1 Reply Last reply
          0
          • R Rajkumar R

            toxcct wrote:

            the VC6 debugger is not very powerful (actually, VC6 itself is far outdated by its new versions). so if you want to see the other elements, you have to specify yourself the address of the element you need to watch AFAIK...

            you are correct, But viewing the List items is very simple from VC6.0, we don't want to explicitly specify the address of the next element, it shows tree view in the watch window and expands the list if the first element is in the watch window.

            struct ListNode
            {
            int iData;
            struct ListNode *pNext;
            };

            int main(int argc, char* argv[])
            {

            struct ListNode Head, Middle, Tail;
            Head.pNext		= &Middle;
            Middle.pNext	= &Tail;
            Tail.pNext		= 0;
            
            return 0;
            

            }

            I can view the list items in the above program as tree view in the watch window of VC6.0, even VC6.0 supports drag and drop variable to watch window.

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            I know what is a linked list, but I don't think the OP is using them at all. hence my reply, refering to arrays and pointer arithmetic. I think he used the term "list" when he wanted to say "array"...

            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            R 1 Reply Last reply
            0
            • T toxcct

              I know what is a linked list, but I don't think the OP is using them at all. hence my reply, refering to arrays and pointer arithmetic. I think he used the term "list" when he wanted to say "array"...

              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              R Offline
              R Offline
              Rajkumar R
              wrote on last edited by
              #6

              toxcct wrote:

              I think he used the term "list" when he wanted to say "array"...

              struct ListNode list[3]; struct ListNode *plist = list; still i can view as tree control of array element with tree labels like [0], [1], [2] .. in VC6.0 watch window when watching variable as "list" and "plist,3"

              1 Reply Last reply
              0
              • E Ernest Laurentin

                I think in VC6, you can type something like: 'list,m' in the watch window This will show you the entire memory. VS2003, 2005, 2008 supports this.

                God bless, Ernest Laurentin

                W Offline
                W Offline
                wendyyue
                wrote on last edited by
                #7

                thanks , you answer is right.

                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