I have a function that I am trying to create, which has an attribute that is a two-dimensional array.
However, I am not sure what I am doing.
This is what I have:
class Savings : public Account {
protected:
string sTrans[2][2];
public:
string transtype;
void Transfer(string a, string b){
if (a == "Debit" || a == "debit"){
double c = std::stod(b);
acc_balance = acc_balance - c;
transtype = "Debit";
}else if (a == "credit" || a == "Credit"){
double c = std::stod(b);
acc_balance = acc_balance + c;
transtype = "Credit";
}
}
};
My goal is to create the array, sTrans[2][2]
, and then store the data I receive from user inputs.