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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debugging in VC++

Debugging in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++
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.
  • R Offline
    R Offline
    Raj Prathap
    wrote on last edited by
    #1

    Hi, I have a for loop, which executes for 100 times. I want to skip initial 50 iterations, and from 51st iteration, I want to execute the code statement by statement. Please suggest, if any easy method is there. Thanks and regards, Raja Pratap

    P N 2 Replies Last reply
    0
    • R Raj Prathap

      Hi, I have a for loop, which executes for 100 times. I want to skip initial 50 iterations, and from 51st iteration, I want to execute the code statement by statement. Please suggest, if any easy method is there. Thanks and regards, Raja Pratap

      P Offline
      P Offline
      Programm3r
      wrote on last edited by
      #2

      Something like this ....:wtf::omg:int y=0; for (int x=0;x<100;x++) { if (y>=51) { printf("51st iteration: %d", y) } y++; }
      Regards,


      The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :)Programm3r My Blog: ^_^

      R 1 Reply Last reply
      0
      • P Programm3r

        Something like this ....:wtf::omg:int y=0; for (int x=0;x<100;x++) { if (y>=51) { printf("51st iteration: %d", y) } y++; }
        Regards,


        The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :)Programm3r My Blog: ^_^

        R Offline
        R Offline
        Raj Prathap
        wrote on last edited by
        #3

        I want to debug using the visual studio debugger. Meaning using F9 and F10..etc mechanism. I meant to ask, if there is some way to iterate for 'n' many times in a particular loop.

        P 1 Reply Last reply
        0
        • R Raj Prathap

          Hi, I have a for loop, which executes for 100 times. I want to skip initial 50 iterations, and from 51st iteration, I want to execute the code statement by statement. Please suggest, if any easy method is there. Thanks and regards, Raja Pratap

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          you can put a conditional break point. To do this follow this steps eg for( int nIdx =0;nIdx<100;nIdx++) { ... } 1. Put a break point in the next line after for loop. 2. Take the breakpoint window( uner the edit menu or press ctr + B ) 3. select the break point you put in the for loop 4. Press the "condition" button. 5. In the new dialog box apperared enter put nIdx>=50

          nave [OpenedFileFinder]

          R N 2 Replies Last reply
          0
          • R Raj Prathap

            I want to debug using the visual studio debugger. Meaning using F9 and F10..etc mechanism. I meant to ask, if there is some way to iterate for 'n' many times in a particular loop.

            P Offline
            P Offline
            Programm3r
            wrote on last edited by
            #5

            Raj Prathap wrote:

            I meant to ask, if there is some way to iterate for 'n' many times in a particular loop.

            I see ... well Naveen solotion should work :) Regrads


            The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :)Programm3r My Blog: ^_^

            1 Reply Last reply
            0
            • N Naveen

              you can put a conditional break point. To do this follow this steps eg for( int nIdx =0;nIdx<100;nIdx++) { ... } 1. Put a break point in the next line after for loop. 2. Take the breakpoint window( uner the edit menu or press ctr + B ) 3. select the break point you put in the for loop 4. Press the "condition" button. 5. In the new dialog box apperared enter put nIdx>=50

              nave [OpenedFileFinder]

              R Offline
              R Offline
              Raj Prathap
              wrote on last edited by
              #6

              Thanks, that solved my problem

              1 Reply Last reply
              0
              • N Naveen

                you can put a conditional break point. To do this follow this steps eg for( int nIdx =0;nIdx<100;nIdx++) { ... } 1. Put a break point in the next line after for loop. 2. Take the breakpoint window( uner the edit menu or press ctr + B ) 3. select the break point you put in the for loop 4. Press the "condition" button. 5. In the new dialog box apperared enter put nIdx>=50

                nave [OpenedFileFinder]

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

                Naveen.R wrote:

                eg for( int nIdx =0;nIdx<100;nIdx++) { ... } 1. Put a break point in the next line after for loop. 2. Take the breakpoint window( uner the edit menu or press ctr + B ) 3. select the break point you put in the for loop 4. Press the "condition" button. 5. In the new dialog box apperared enter put nIdx>=50

                Another suggestion is...

                #ifdef _DEBUG
                #define DBREAK( condition ) if(( condition )){ _asm int 3; }
                #else
                #define DBREAK( condition )
                #endif

                for( int nIndex = 0; nIndex < 100; ++nIndex )
                {
                DBREAK( nIndex == 50 )
                }


                Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

                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