All pastes #190663 Raw Edit

Untitled

public cpp v1 · immutable
·published 2006-10-04 06:47 UTC
rendered paste body
// Item.hclass Item{    tag_t         tag,        revison;    char         *name,        *type;    public:        Item(const char *item_name, const char *type_name) {            name = new char[strlen(item_name) + 1];            type = new char[strlen(type_name) + 1];            ITEM_create_item(NULL, item_name, type_name, NULL, &id, &revision);            strcpy(name, item_name);            strcpy(type, type_name);        }        const char *getName() {            return name;        }        const char *getType() {            return type        }        void setName(const char *new_name) {            ITEM_set_name(tag, new_name);            strcpy(name, new_name);        }        ~Item() {            ITEM_delete_item(tag);            delete [] name;            delete [] type;        }};