Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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