Confused about pointers??????????

HI everyone,
I just want to know consequeces of following code, is it norma?? Or do it will lead to memory leak???

1
2
3
4
char *RTInfo;
...........//do some stuffs
  RTInfo = NULL;
  delete[] RTInfo;
Nothing will be freed, as RTInfo won't have the address of the memory that was allocated
closed account (1yR4jE8b)
You would need to do put your delete statement BEFORE you set your pointer to NULL
Nothing will leak since there was no "new".
closed account (1yR4jE8b)
That is true, assuming there is no 'new' in the //do some stuffs section
Topic archived. No new replies allowed.