20 lines
389 B
C++
20 lines
389 B
C++
|
|
#include "tests_mystruct.hpp"
|
|
|
|
mystruct::mystruct(int data)
|
|
{_val = new int[2]; _val[0] = data; _val[1] = data;}
|
|
|
|
mystruct::~mystruct()
|
|
{delete[] _val;}
|
|
|
|
int * mystruct::get_data() const
|
|
{return _val;}
|
|
|
|
std::ostream & operator<<(std::ostream & o, mystruct const * rhs) {
|
|
if (rhs != NULL)
|
|
o << (*rhs).get_data()[0] << "," << (*rhs).get_data()[1];
|
|
else
|
|
o << "NULL";
|
|
return (o);
|
|
}
|