M
Ich habe jetzt selbst schon was hingekriegt. Das Problem ist nur, dass in der viertletzten Zeile (return_value = ...) beim Debuggen der Fehler kommt
error C2110: cannot add two pointers
Code jetzt:
#include <string>
using namespace std;
class Cell {
private:
Cell* next;
Cell* previous;
public:
//virtual ~Cell();
virtual string display() const = 0;
};
class LinkedList {
private:
Cell* highest;
Cell* lowest;
public:
LinkedList() {
}
void insert(int customer_number, string customer_name, string customer_street, string customer_postcode, string customer_city, string customer_country) {
}
void deletion(int customer_number) {
}
void retrieve(int customer_number) {
}
string display() {
}
};
class BaseEl : public Cell {
private:
int customer_number;
string customer_name;
public:
BaseEl(int number, string name) {
customer_number = number;
customer_name = name;
}
~BaseEl() {
}
int get_number() const {
return customer_number;
}
string get_name() const {
return customer_name;
}
string display() const {
return "test";
}
};
class ListEl : public BaseEl {
private:
string customer_street;
string customer_postcode;
string customer_city;
string customer_country;
public:
ListEl(int number, string name, string street, string postcode, string city, string country) : BaseEl(number, name) {
customer_street = street;
customer_postcode = postcode;
customer_city = city;
customer_country = country;
}
~ListEl() {
}
int get_number() const {
return BaseEl::get_number();
}
string get_name() const {
return BaseEl::get_name();
}
string get_street() const {
return customer_street;
}
string get_postcode() const {
return customer_postcode;
}
string get_city() const {
return customer_city;
}
string get_country() const {
return customer_country;
}
string display() const {
string return_value;
return_value = "Nummer: " + get_number() + "\nName: " + get_name() + "\nStrasse: " + get_street() + "\nPostleitzahl: " + get_postcode() + "\nStadt: " + get_city() + "\nLand: " + get_country() + "\n";
return return_value;
}
};