I'm having some problems with dynamic memory. I experiment with operator "new" for making arrays, which works fine. but the problem is that when I use dynamic arrays in classes or functions, I'm getting memory heap errors...

The thing's that lets say I have one dynamic int var in the main function, I put it length to 10 000 000, just for tests. But when I do the exact thing inside a class, it fails...

Code:
void main()
{
    int *a;
    a = new int[10000000];
}
That works, but not this:

Code:
class abc
{
    public:
        int *a;
        abc()
        {
            a = new int[10000000];
        }
        ~abc
        {
            delete a;
        }
};

void main()
{
    abc i;
}

Is it possible that a class or function or structure (or other...) may limit the amount of memory possible to use in a program?