Add the bold character:
std::ostream& operator<<(std::ostream &out, Student &s)
If you pass by copy, when the function return the local copy goes out of scope and releases its pointers, but because Student doesn't have a copy constructor, in doing so it also releases the pointers of the original, invalidating those pointers.