Changed this Item::Item(char *name, double weight) { name = nullptr; weight = 0; Item::setName(name); }