64,654
社区成员
发帖
与我相关
我的任务
分享
#include <iomanip>
#include <iostream>
#ifndef LIST_H_
#define LIST_H_
using namespace std;
template <class T>
class node{
public:
T data;
node<T> *next;
};
template <class T>
class List{
public:
List();
private:
node<T> *head;
};
#endif
#include "list.h"
template<class T>
List<T>::List(){
head = new node<T>;
head->next = 0;
}
#include "list.h"
using namespace std;
int main(){
node<int> node;//OK
List<int> iList;//ERROR
return 0;
}