All pastes #607483 Raw Edit

Anonymous

public cpp v1 · immutable
#607483 ·published 2007-07-07 17:06 UTC
rendered paste body
#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;}*/