the new statement is not in the loop, and neither is the delete. I now see why delete comes before NULL.
Like it says up top, this is the format of the pointer:
I don't declare static...is that whats causing the problem? that it keeps allocating more and more memory without freeing it all? If declaring static would fix the problem...how would i go about doing it? like so?:
char * szBuffer=new char ;//have to use pointer for certain functions
delete  szBuffer; <--Causes an error when the program closes, one of the last things done before return 0 is this step.
//but i have the following
szBuffer=NULL;//causes memory leak but no error
delete  szBuffer;
memory management is not one of my strong points...I've never been taught the do's and don'ts so i play it by ear and end up with these errors, so if you could bear with me that'd be great. thanks.
new static char * szBuffer;//now how do i make it 246 bytes in size?