Stack overflow problem.....

Posted 30 October 2012 - 10:03 AM

There is a stack overflow error when I run it on visual studio. How do I fix it? What is the problem? It is on the line containing: return factNminusR * factorialNminusR ( nMinusRtotal - 1 ); (line 37) or around there. Is it because the calculation is too big?

Re: Stack overflow problem.....

Posted 30 October 2012 - 01:47 PM

I think I figured it out. I'm sorry if it was confusing Jim, but I was aware of the problem because of both putty and the debugger of Visual Studio. I just wasn't too sure on what it exactly it meant. As I assumed, it is because the line I mentioned outputs too large of memory for the memory value I assigned. If I didn't say this right, I apologize, and I would guess you get what I mean. Therefore, I need to assign a larger value to that variable. I don't know which one yet, but I will try to figure it out. If you want to help, by all means. If not, no worries, and I will write back on this if I run into issues.

Do you really need to call these three recursive functions on the same line. You are probably burning through your available stack memory half way thru this mess.

Jim

Jim,

I was able to figure it out. I did do adjustments to make it less messy and I don't know if that was the actual cause because after I figured out the problem, it works just fine. The problem was I was putting values for n and r that would cause the solution to be negative. Once I started to put n bigger than r it works fine.

Second, about your "mess" comment. One thing that I don't like, and this may be the problem with emails and emotions through them, but to tell somebody you are trying to help that their code is a mess is not very encouraging. I could not picture my college instructor telling me or somebody else that when helping them their work is a mess. If I come off sensitive, so be it. I very well may be sensitive, but at the same time I take words pretty serious I guess you could say. I'm not saying you are good help, because you are. You've helped me with this assignment as well as a previous one. Also, last time, I complained about how I've been spoken to regarding help my post got ceased and I got the -2 reputation as you see now. Therefore, if you, or anybody does this again, I'm going to laugh as I did the last one.

Re: Stack overflow problem.....

Posted 30 October 2012 - 05:41 PM

Quote

Second, about your "mess" comment. One thing that I don't like, and this may be the problem with emails and emotions through them, but to tell somebody you are trying to help that their code is a mess is not very encouraging.

Take a step back for a minute. Nobody is coming here simply to bash you or your code. A lot of our members are very direct when helping, not to be rude, but simply so to get the point across to fix things and move onto the next problem. If somebody is doing something the wrong way, should it be encouraged or corrected? Nobody here is flaming you, or coming here simply to bash you or your code. Take it in strides and try to find the helpful advice in it all. This is the internet, after all.

Quote

Also, last time, I complained about how I've been spoken to

The last time, you called someone a dick head. Quoting from your post below.

Quote

Xupicor or DIC head, however you want to be called, the second name (nick name) goes with your attitude.

If you really feel somebody is attacking you, then you are welcome to shoot myself or another team member a PM to discuss further.

Re: Stack overflow problem.....

Posted 30 October 2012 - 06:24 PM

macosxnerd101, on 30 October 2012 - 05:41 PM, said:

Quote

Second, about your "mess" comment. One thing that I don't like, and this may be the problem with emails and emotions through them, but to tell somebody you are trying to help that their code is a mess is not very encouraging.

Take a step back for a minute. Nobody is coming here simply to bash you or your code. A lot of our members are very direct when helping, not to be rude, but simply so to get the point across to fix things and move onto the next problem. If somebody is doing something the wrong way, should it be encouraged or corrected? Nobody here is flaming you, or coming here simply to bash you or your code. Take it in strides and try to find the helpful advice in it all. This is the internet, after all.

Quote

Also, last time, I complained about how I've been spoken to

The last time, you called someone a dick head. Quoting from your post below.

Quote

Xupicor or DIC head, however you want to be called, the second name (nick name) goes with your attitude.

If you really feel somebody is attacking you, then you are welcome to shoot myself or another team member a PM to discuss further.

Look back at the post and try to understand why I said it. I was not calling him a dick head. I originally thought "DIC head" was what he purposely made for his name. Then I saw that it's the name for everybody. Which concludes that this site should think about changing that portion. I hope this makes sense.

jon.kiparsky, on 30 October 2012 - 05:50 PM, said:

ZacCarlson, on 30 October 2012 - 07:29 PM, said:

I'm not saying you are good help, because you are. You've helped me with this assignment as well as a previous one.

So, I'm thinking "thank you, Jim" might be a good place to go from here?

And your team talking about not spoon feeding me? What is this garbage? Are you my mother, my father?

Re: Stack overflow problem.....

Posted 30 October 2012 - 06:31 PM

Just to add- the whole purpose of DIC is to help others learn how to program. This involves a pedagogic approach to teach people how to fish, so to speak, rather than feeding them for a day. Part of this involves constructively criticizing code. Having read through your threads, I believe this has been done by all who have attempted to help you. Again, you are welcome to shoot me a PM if you wish to discuss further.

Re: Stack overflow problem.....

Posted 30 October 2012 - 06:48 PM

macosxnerd101, on 30 October 2012 - 06:31 PM, said:

Just to add- the whole purpose of DIC is to help others learn how to program. This involves a pedagogic approach to teach people how to fish, so to speak, rather than feeding them for a day. Part of this involves constructively criticizing code. Having read through your threads, I believe this has been done by all who have attempted to help you. Again, you are welcome to shoot me a PM if you wish to discuss further.

I'm done with all this. Look at the name, DIC, say it out loud with out saying it as it should be, as in, "D", "I, "C". Say it as a whole, "DIC". Do you see my point? If you don't, I'm sorry to hear that. Have a nice day.