I get a Runtime error which i can't understand. Please help!
class A
{ private:
string x, string y;
double z;
public:
A(string,string,double) // parameterized constructor
}
A CreateA(A& newA) // function returning an A object
{
newA = A(a,b,c) // a,b,c are entered by user from cin as string,string,
// double respectively.
}
int main()
{
A a;
vector <A> list;
list.push_back(CreateA(a));
}
Thank you Jonnin. I made the function CreateA() as a void function and it worked. There was no need for me to return any thing because i passed by reference. Thanks again!