type redefinition

I am creating a class that contains no public variables to be used in a linked list but when i try to use the class in the functions to "get" and "set" the data i am getting a type redefinition error, am i making a stupid error?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class details {
private:
	string publisher;
	int isbn;
	string title;
	string author;
	string editor;
	string date;
public:
	string getPublisher();
	int getIsbn();
	string getTitle();
	string getAuthor();
	string getEditor();
	string getDate();

	void setPublisher(string value);
	void setIsbn(int value);
	void setTitle(string value);
	void setAuthor(string value);
	void setEditor(string value);
	void setDate(string value);
};

//get details
string details::getPublisher(){
	return publisher;
}
int details::getIsbn(){
	return isbn;
}
string details::getTitle(){
	return title;
}
string details::getAuthor(){
	return author;
}
string details::getEditor(){
	return editor;
}
string details::getDate(){
	return date;
}

//set details
void details::setPublisher(string value){
	publisher = value;
}
void details::setIsbn(int value){
	isbn = value;
}
void details::setTitle(string value){
	title = value;
}
void details::setAuthor(string value){
	author = value;
}
void details::setEditor(string value){
	editor = value;
}
void details::setDate(string value){
	date = value;
}

What is the actual, full error? Don't paraphrase it -- post the whole thing. Also tell us what line it's on.

The only thing I can think of is that you are including the header multiple times.

See section 3: http://cplusplus.com/forum/articles/10627/#msg49679
Ah i see thanks, that link explained why, i was including it in another header and then also including the header containing this class and the other header including this class in my main cpp file, Thanks Disch
Topic archived. No new replies allowed.