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

Thread: Error

  1. #1
    Join Date
    Feb 2005
    Posts
    39

    Error

    can any one give me the resoan of unhandeled exception error message?????????

  2. #2
    Join Date
    Mar 2005
    Posts
    3

    Re: Error

    1)The most common reason is a read/write in a zone of memory where you
    should'nt do that(when you go out of the bounds of a array for example or a crazy memcpy)...
    2) The second most common reason is a divsion by zero

    What does exactly your message say?

    Ehrs

  3. #3
    Join Date
    Feb 2005
    Posts
    39

    Question Re: Error

    i have four for loop .....

    int a[256][256],b[8][8];

    for(int i=0;i<256;i+=8)
    {
    for(int j=0;j<256;j+=8)
    {
    for(int x=i;x<(i+8);x++)
    {
    for(int y=j;y<(j+8);y++)
    {
    b[x][y]=a[x][y];
    cout<<b[x][y]<<"\t";
    }
    cout<<endl;
    }
    }
    cout<<endl;
    }

    when i run this program it gives me unhandeled exception>>>>>

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Error

    I don't know what you are doing, but you are accessing your b array beyond its boundary, meaning a memory error. For example:
    your for(int x=i;x<(i+8);x++), when i > 8, you will access b beyond its bounds.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

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