CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: debug mode

  1. #1
    Join Date
    May 2011
    Posts
    23

    debug mode

    forgive me for lack of more info. In the "start debugging" mode, in case 1, the main never begins, i see circled cursor, but in case 2 it does. why?. vc2008.

    case 1:
    int main(...)
    {
    std::cout << "Begin .." < std:;endl;
    Myclass myc;
    myc = ref.rcl(...);

    if A(...)
    {
    ...
    myf.open(myc.f().file1);
    myf.close();
    myf.clear();
    }
    if B(...)
    {
    ...
    myf.open(myc.f().file1);
    myf.close();
    myf.clear();
    }
    if C(...)
    {
    ...
    myf.open(myc.f().file1);
    myf.close();
    myf.clear();
    }
    etc.
    }

    case 2:
    int main(...)
    {
    Myclass myc;
    myc = ref.(...);
    char *s = myc.f().file1;
    if A(...)
    {
    ...
    myf.open(s);
    myf.close();
    myf.clear();
    }
    if B(...)
    {
    ...
    myf.open(s);
    myf.close();
    myf.clear();
    }
    if C(...)
    {
    ...
    myf.open(s);
    myf.close();
    myf.clear();
    }
    etc.
    }

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: debug mode

    No idea what you're trying to do. Why would the definition of main be inside a switch statement?

  3. #3
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: debug mode


    Spotted this however
    Code:
    std::cout << "Begin .." < std:;endl;
    but since the entire code is mutilated it probably doesn't mean anything.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured