I have a class named variable
which has
string name;
double value;
and I have another class named mainwindow
(by the way it is qt application.)
in main window I have a vector
vector<variable> vect
I want a class which push_back
variable objects with using vect which is under main window
I wrote this but it gave me error
class add_variable
{
private:
variable var;
MainWindow &vectholder;
public:
void push_back(var.getname(),var.getvalue());
};
errors
error: 'var' is not a type
error: expected ',' or '...' before '.' token
also I want to reach these variables which is pushed into vector I want to call them within another class