Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

C++ System.StackOverflowException (MicrosoftVisualStudio.NET)


  • Please log in to reply

#1
daniel_d

daniel_d

    New Member

  • Member
  • Pip
  • 2 posts
I have written some lenthy c++ which should perform quite a number of calculations. Inputs are a matrix of dimension n*m and a few numbers. The programm works for small values of n and m (e.g. n=m=100), but if I try to raise the dimension-restriction, it won't work.Error-Message:"An unhandled exception of type 'system.StackOverflowException" occurred". I need the programm for large matrices (n=m=1200) and i do not comprehend, why this programm is unable to hande big matrices. What did I mess up? Could anyone maybe find the time to actually take a close look at my admittedly lengthy programm and tell me which parts I have to change?
  • 0

Advertisements


#2
ricci

ricci

    Member

  • Member
  • PipPip
  • 64 posts
Hi Daniel,

It sounds like your program uses recursion to do the matrix calculations. You won't be able to use it for matrices greater than a certain size without modifying the code to iterate through a loop instead repeatedly calling the same function.

-Ricci
  • 0

#3
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
Probably exactly right. If you're calculating determinants, for example, recursively, then you'll blow the stack out VERY quickly a recursive routine 1200 times..... Rewrite it iteratively so that you can allocate your own memory. :tazz:
  • 0

#4
daniel_d

daniel_d

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
Thank you very much!! I will try it out.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP