18-02-2011, 19:25
|
|
|
חבר מתאריך: 08.08.10
הודעות: 7
|
|
עזרה בC++
היי לא ברור לי למה הקוד הבא של טמפלט כותב לי שחסרים נתונים אשמח לעזרה זה כותב לי בcpp שחסרים פרטים עבור התיפוס Set
קובץ header
קוד:
//seperate from the body
#ifndef SET
#define SET
//include
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
template <typename T>
class Set
{
public:
Set(int=10);//defult constactor
~Set()
{delete [] data;;
friend ostream &operator<<(ostream&,const Set&);
private:
T *data;
int size;
};
#endif
קובץ cpp
קוד:
#include "Set.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
ostream &operator<<(ostream &output,const Set &s)
{
}
|