L
laniik
I am relativly new in c++, so Im not entirely sure about how the memory
allocation stuff works. My problem is that i am running out of memory
after what is seemingly a very small amoune of memory allocation.
i have a class:
struct Point{
void set(int,int,int);
float distance(Point);
int x,y,z;
};
i am doing all my allocations with new, for example:
Point* points = new Points[256];
(which i do 4 times)
(i am making sure to delete[] points; however, my program is crashing
before it even gets to the deletes)
i get crashes in built in functions like strlen(). which im assuming
just means that i am out of memory, OR that my memory has become
corrupted. but just 1024 instances of a small class cannot be anywhere
near the maximum amount of memory that I can use in a program can it?
is there anyway to allocate more memory?
Thanks!
Oliver
allocation stuff works. My problem is that i am running out of memory
after what is seemingly a very small amoune of memory allocation.
i have a class:
struct Point{
void set(int,int,int);
float distance(Point);
int x,y,z;
};
i am doing all my allocations with new, for example:
Point* points = new Points[256];
(which i do 4 times)
(i am making sure to delete[] points; however, my program is crashing
before it even gets to the deletes)
i get crashes in built in functions like strlen(). which im assuming
just means that i am out of memory, OR that my memory has become
corrupted. but just 1024 instances of a small class cannot be anywhere
near the maximum amount of memory that I can use in a program can it?
is there anyway to allocate more memory?
Thanks!
Oliver