I am trying to create a class with a list of a user-defined data type as its member. I get the error: ISO C++ forbids declaration of 'list' with no type. Could anyone tell me what I should change in the code to get it to work? (in util.h line 13)
Thanks!
Filename: main.cpp
#include<iostream>
#include<list>
#include "util.h"
using namespace std;
REFERENCE_SET ref_set;
int main(){
REFERENCE_SET s;
return 0;
}
Filename: util.h
#ifndef UTIL_H
#define UTIL_H
class ARRAY{
public:
int ele[100];
int size;
ARRAY();
};
class REFERENCE_SET{
public:
list<ARRAY> perm;
int size;
REFERENCE_SET();
};
#endif
Filename: util.cpp
#include "util.h"
ARRAY::ARRAY(){
size = 0;
}
REFERENCE_SET::REFERENCE_SET(){
size = 0;
}
This post has been edited by machoolah: 26 July 2011 - 05:17 PM

New Topic/Question
Reply




MultiQuote




|