Anonymous
public cpp v1 · immutable#include <string>struct Item{ char* Link; Item(const Item&); ~Item();}Item::Item(const Item& src):Link(strdup(src.Link)){}Item::~Item(){ delete Link;}/* is there a memory leek, because Link was assigned with strdup and destroyed by delete Link only? or the destructor must be like this one:Item::~Item(){ free(Link) delete Link;}*/