I need to read a file which looks like this:
model=binomial
steps=1
time horizon=1
S=101
u=1.2
d=0.95
r=0.03
number of instruments in portfolio=2
instrument=option
exercise=european
position=short
type=put
strike=98
expiry=1
instrument=option
exercise=european
position=long
type=put
strike=10
expiry=1
and i just need to read everything what is on the right site of '=' into a structure, because i will need to use this numbers and strings later.
all i have written is just a structure:
struct input
{
string model;
int steps;
int timehorizon;
int S;
int u;
int d;
int r;
int noiip;
std::vector<string> instrument;
std::vector<string> exercise;
std::vector<string> position;
std::vector<string> type;
std::vector<double> strike;
std::vector<double> expiry;
};
please, i really need help. :(