CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: navy1991

Search: Search took 0.01 seconds.

  1. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    The correct solution still eludes me. Every thing seems to work correct . I tried debugging line by line too. The method tries to search the correct combination by backtracking method. So even after...
  2. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    At GCDEF,

    you are absolutely correct. I will try to use the debugger to interrupt execution and follow execution and to do all the fun stuff.

    Regards.
  3. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    The specific problem is this:

    This is the BASIC code of CheckPoss function:


    FUNCTION CheckPoss (u)
    tot = tot + 1
    f = 0
    SELECT CASE u
    CASE 2
  4. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hi OReubens,

    I did like you told.I got a code like this:
    throw -- terminate on thrown exception REPLACEABLE
    #define _HAS_EXCEPTIONS 0
    #include <cstdio>
    #include <cstdlib>...
  5. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    When I debugged it after removing comments , I got like this in the command window:

    DEBUG2: m = 3 i = 0
    {f} = 2 {u} 2
    DEBUG2: m = 2 i = 0

    The bug is exactly here at the end of...
  6. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hello Victor,

    This is the reply that i get on my console window:

    188 possibilities checked.
    2147 million possibilities discarded.
    0 solutions found.
    Press any key to continue . . .

    I...
  7. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hello Paul,
    I will follow your advice from now on.

    Regards,
    Naveen.
  8. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hello victor,

    please check the code below:


    #include <iostream>
    #include <math.h>
    #include <string>
    #include <cstdlib>
  9. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hi Paul,
    My plan was to follow the logic as explained for the BASIC program. With this in mind, I started writing my code. In BASIC programming, the array starts from 1, but in C++ it starts...
  10. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hello Victor and Paul,

    Here you go: This is the formatted code , which I am trying:


    #include <iostream>
    #include <math.h>
    #include <string>
    #include <cstdlib>
  11. Replies
    22
    Views
    23,003

    Re: Please find the bug in the c++ code

    Hello Paul,
    I figured out that in the CheckPoss function, case 8 is not being checked .I tried to find the value of 'f' by inserting the comments , which u can see. But, I am still not...
  12. Replies
    22
    Views
    23,003

    Please find the bug in the c++ code

    #include <iostream>
    #include <math.h>
    #include <string>
    #include <cstdlib>

    using namespace std;
    long tot, tsol;

    int P[8][6];
    int A[8][1];
Results 1 to 12 of 12





Click Here to Expand Forum to Full Width

Featured