class c1{
public:
c1(int AO, int AE){
x=AO;
y=AE;
}
private:
int x,y;
};
class c2{
public:
//c2(int x, int y, bool target): obj1(x, y), flag(target){}
c2(int x, int y, bool target){
obj1=c1(x,y)
flag=target;
}
private:
c1 obj1;
bool flag;
};
If i write the line with the constructor in the comments, it runs. How can i write c2(int x, int y, bool target) in order to compile? (the error message is not matching function for call to 'c1:c1()')