Hello guys im using Xcode on Yosemite OS, when i try to use these operators i got error Control reaches end of non-void function,could someone tell me how to fix it?
`A& A::operator= (A& src)`
{
delete[] b_;
i_ = src.i_;
b_ = new B[i_];
for(int i = 0; i < i_; i++)
b_[i].set(src.b_[i].get());
} `//Here appear this error>> Control reaches end of non-void function`
std::ostream& operator<< (std::ostream& str, const A& a)
{
str << a.i_ << ":";
for(int i = 0; i < a.i_; ++i)
str << " " << a.b_[i].get();``
return str << std::endl;
}
std::istream& operator>> (std::istream& str, A &a)
{
int i;
str >> i;
A* b = new A(i);
a = *b;
} //Here appear this error>> Control reaches end of non-void function
Aucun commentaire:
Enregistrer un commentaire