> I don't know what the underscore is for
name filling.
variables names can have
[A-z0-9_]
> why is there brackets with nothin in them "()"
I suppose that should be
virtual double operator()(double S) const;
check out operator overloading, there you are declaring parenthesis.
Then you may do
1 2
|
PayO &foo = //...
foo(3.14);
|
> and then the const at the end
that particular member function would not modify the calling object, so it can be used with constant objects.
> the destructor is used to free the memory occupied by the constructor "PayOffD"
The destructor does nothing because nothing needs to be done.
¿where in
{}
are you freeing memory?
1 2
|
PayOffD::PayOffD(double LowerLevel_, double UpperLevel):
LowerLevel(LowerLevel_), UpperLevel(UpperLevel_){}
|
initialization list.
There you may call the constructor of your member variables and your parent class.
> we implement the function operator()
¿? ¿now you know what it is?