0
Need help with overloading <<, >> operators for pointers C++
I get segmentation fault when my program runs into this section of my program: ostream& operator<<(ostream& output, TrashCan*& p) { output << "Size = " << p->my_Size << " Contents = " << p->my_Contents << endl; return output; } it runs fine with the regular << >> overload without pointers though
1 Réponse
0
Are you sure that you can use refference and derefference operator at the same time. Try just with &p