newbie question
template <class type>
class BigClass
{
private:
type* item;
public:
BigClass(int = 100);
~BigClass();
};
template <class type>
BigClass<type>::BigClass(int size)
{
item = new type[size];
}
template <class type>
BigClass<type>::~BigClass()
{
delete [] item;
}
#include <stdlib.h>
#include "BigClass.h"
#include <string>
using namespace std;
struct StTwo
{
int a;
};
struct StOne
{
string b;
BigClass<StTwo> obj(5);
};
void main()
{
StOne New1;
}
I get this error:
-------Configuration: tester - Win32 Debug-------
Compiling...
tester.cpp
C:\VCppProj\tester.cpp(19) : error C2059: syntax error : 'constant'
Error executing cl.exe.
How can I initialize the class object. I didnt think I would get an error trying to initialize.:wave:

