I'm using Visual Studio .Net and I have run the memory leak test on my program. It is failing to release a few structures I have created in my program and I'm not sure how I'm supposed to do it.
Here is a simple version of the program I am using:
struct s
{
bool a;
char* b;
int c;
};
void main()
{
s* cont = new s();
while(1)
{
fillCont(s);
}
delete cont;
}
void fillCont(s* cont)
{
r->a = true;
r->b = "Item1";
r->c = 100;
}
Any help would be appreciated,
Thanks
Here is a simple version of the program I am using:
struct s
{
bool a;
char* b;
int c;
};
void main()
{
s* cont = new s();
while(1)
{
fillCont(s);
}
delete cont;
}
void fillCont(s* cont)
{
r->a = true;
r->b = "Item1";
r->c = 100;
}
Any help would be appreciated,
Thanks