with a struct with no pointers, memcpy will work. In actualality, you dont need one in this situation as this is the default behaviour for a struct.
with a struct with pointers, you will need to redefine how you copy it or you will do a shallow copy.
with a class, always redefine it (in my opinion)
class sample
{
void operator =(sample& s)
{
membervars = s.membervars;
// depending on "type"
memberpointers = new type;
memcpy(memberpointers,s.memberpointers);
// copy constructor
memberpointers = new type(s.memberpointers);
}
}
it is a very basic explanation but it should get you started

Repost if you run into problems. What you want to be careful of are shallow copies. That is when you have a pointer and you dont allocate new memory for it but instead just set your pointer to the original pointer value. If the old object goes out of scope, you pointer to its memory block still exists BUT that block of memory has been deleted.
Matt