Delete a structure
I have a structure like this:
typedef struct COLOR{
int r;
int g;
int b;
int a;
}COLOR;
typedef struct VERTEX{
int x;
int y;
int z;
COLOR color;
}VERTEX;
VERTEX *vVertex;
and i can''t free the vVertex. Can somebody help me?
Have you done sth. like
this?
You may get into trouble if you try to delete
(
baumep
VERTEX *vVertex = new Vertex;
//...code....
if(vVertex) delete[] vVertx;
this?
You may get into trouble if you try to delete
vVertx
without initializing it/allocating memory for it as in the last line of your code you posted.(
new
and delete
equal malloc
and free
in c)baumep
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement