473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with debugging code

I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@yahoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein

Jan 5 '06 #1
4 1545

pauldepst...@att.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@yahoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Sorry. On rereading the above posting, I see that readers would have
to go through an unnecessary second process to obtain my email address.

My email address is pauldepstein at yahoo dot com

Thanks again for your help and support.

Paul Epstein

Jan 5 '06 #2
pauldepst...@att.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@yahoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Have you run through the program in your debugger? Can you boil it down
to a simple but complete example that demonstrates the same problem?
See this FAQ on posting code:

http://parashift.com/c++-faq-lite/ho...t.html#faq-5.8

Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).

Cheers! --M

Jan 5 '06 #3

mlimber wrote:
pauldepst...@att.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

The problem is that the code is much too long to be suitable for
inclusion in this posting, and I don't know where the problem lies.

If anyone does have the time/willingness/extreme kindness to help me, I
would think that the simplest thing would be for them to get in touch
with me at pa**********@yahoo.com

I can be reached by yahoo IM also. My yahoo ID is pauldepstein.

If anyone feels they could help me but only on a paid basis, please let
me know and we'll try and work something out.

Thank you,

Paul Epstein


Have you run through the program in your debugger? Can you boil it down
to a simple but complete example that demonstrates the same problem?
See this FAQ on posting code:

http://parashift.com/c++-faq-lite/ho...t.html#faq-5.8

Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).

Cheers! --M


Thank you, M limber!

I think your "wild guess" is probably correct. Here is more info on
the code: I set a variable J using a function which is a member of the
parameters class.

I then access J in several places and inside recursive functions using
the line: int J = params_ptr->get_int("J");

if (!strncmp (in_string, "J", 100)) {return J; } is part of the
get_int function.

This accessing of J seems to work going through the loop a few times
but not on the sixth.

So your "guess" is very helpful.

I am very much a newbie and have no idea how to enlarge the stack size.

The IDE is dev c++. Of course, I would be happy to research the topic
of stack-size-enlarging-using-Dev-c++ independently. (I will google it
immediately after this posting.) I merely mention my ignorance of
this, by way of reply to your advice.

Thank you,

Paul Epstein

Jan 5 '06 #4
mlimber wrote:
pauldepst...@att.net wrote:
I am writing code to price some financial options using recursive
functions.

It compiles but I get a runtime error which is caused by a memory
violation.

<snip>
Wild guess: you're overflowing your stack because of repeated
recursion. Try enlarging the stack size (perhaps in the project
settings if you're using an IDE, or maybe via a command line tool in
some flavor of unix).


....and of course, make sure that the recursion is bounded!

We should be able to see what's wrong by seeing the declaration of the
recursive function, the initial values passed to it, and anything inside
the function that modifies any of the values passed to it.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Jan 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
5
by: Jerry Polyak | last post by:
Can someone give me a pointer, please. I am getting the following errors: Notice: Undefined index: sender_name in c:\program files\apache group\apache\htdocs\allinone_form.php on line 12 ...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
4
by: VicVic | last post by:
Dear Great Experts, I have a problem and need your help! We have a Flat DLL built in C++ (CCC), and on top of it, we built another DLL built in C# (SSS), which has .Net Assembly. CCC was...
4
by: Jason Hunt | last post by:
I'm hoping someone can help me out with using the Visual Studio IDE for debugging. I'm working on a Windows Forms application (it's an MDI if it matters), and I'm trying to fix a bug in my...
4
by: Martin Odhelius | last post by:
Hello, I have a very fustrating problems while debugging ASP.NET applications. When I am debugging and stepping thru code (with F10 or F11) Visual Studio some times suddenly just stop responding...
7
by: yuanlinjiang | last post by:
I am working on converting a win32 console application from VC6 to VC7. My version is Microsoft Development Environment 2003 version 7.1.3088. The code works fine on VC6. it is a console...
23
by: keyser_Soze | last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on this machine and I am trying to debug some existing code which has both ASP and ASP.NET components. When I try and launch...
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
4
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm working on a web app in VS2005 (.net 2.0.50727). All is working fine, except when I add a HTTPModule to my web.config file, as follows... <httpModules> <add name="UrlRewrite"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.