Overcalculation/Overflow issue

This is a discussion on Overcalculation/Overflow issue within the Windows Programming forums, part of the Platform Specific Boards category; I don't know if I used the right terms. I am writing a program to create and pathing of a ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    China
    Posts
    11

    Unhappy Overcalculation/Overflow issue

    I don't know if I used the right terms. I am writing a program to create and pathing of a big maze, that had involved a lot of calculation. The program sometimes works fine, but sometimes make the machine hangs up. Looks like the huge operations make it crash. Will there be any method to fix it? Or something like increase the internal memory? Tks.

  2. #2
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    The problem can be a stack overflow. In which case a recursive function or method uses too much static memory.
    The problem might be an infinite loop. In some cases it never ends.
    The problem might be indeed too much calculations/memory consumption in some cases.

    There are a lot of possible solutions depending on the problem. So post some code.

    If you think that it is a memory problem, try freeing memory you don't need anymore before allocating new. If you think it is too much calculations, then inspect your algorithm in the worst case scenarios.

  3. #3
    Registered User
    Join Date
    Apr 2010
    Location
    China
    Posts
    11
    Tks. Attached is the source code. Please help and provide your valuable advise. By the way, would you need me know how to " freeing memory you don't need anymore before allocating new"? I guess it would help. Tks.
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 05:56 AM
  2. type safe issue
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-12-2008, 09:32 PM
  3. Metaprogramming Issue
    By schultz in forum C++ Programming
    Replies: 8
    Last Post: 10-08-2007, 06:11 PM
  4. Replies: 8
    Last Post: 01-17-2006, 05:39 PM
  5. my first issue of GDM
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-12-2002, 05:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21