Hi
I have a simple program to evaluate integrals via monte-carlo.
Currently the program has a hard coded expression on which to perform the integration, but I'd like to be able to pass in a string as an argument to the program so that I don't have to edit the source each time.
Actually I can come up with a perl or sed script to change the line in question fairly easily, but then I'd have to save under another name, and also it didn't appear very elegant.
I could also grab the string from the command line and try matching to predefined strings in a switch statement, which would tell the program what to do if the string matched. But I'd be very limited in the range of expressions I could use.
Any quick ideas from anybody?
Many thanks!