All pastes #440730 Raw Edit

308 Project 7

public cpp v1 · immutable
·published 2007-04-15 07:33 UTC
rendered paste body
#ifndef LIST_H#define LIST_H#include "node.h"#include <iostream>using namespace std;class List {		private: 		Node* head, *tail;		int list_size;	public:		List() { this->head = NULL; this->tail = NULL; list_size = 0; }		void insert(int);		int& operator[](int) const;		int size() const;		void reverse(void);};ostream& operator<<(ostream& out, const List& listObj) {	int i = 0;	for(i;i<listObj.size(); i++)		out << listObj.operator [](i);     return out;}#endif/* The Error:Error	4	error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class List const &)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABVList@@@Z) already defined in list.obj	main.obj*/