Code:
you wrote a class that does not diffentiate between the member functions and the data members... you should use the member access specifiers...public, private, protected.
to modify your class do the following:
1. write the constructor and destructor under the public section.
2. you should write a semi-colon at the end of the class definition.
class allocator
{
double* array;
public:
allocator(arraysize): array(new double[arraysize])
{
}
~allocator()
{
delete [] array;
}
};
int main()
{
allocator a1(5);
}