As promised here is my next question about pointers as strings. This question relates to how to properly free memory when deleting a pointer or exiting a program.

Code:
char* string = new char[8];
strcpy(string, "letters");
delete string;
Will this work? No memory leaks, other problems etc...?

Code:
char* function (void)
{
     char* string = new char[8];
     strcpy(string, "letters");
     return string;
}

char* astring = new char[8];
astring = function();
delete astring;
Will this work? Will this delete both string and astring? Could I just set astring equal to the return of function without allocating memory first?

One more question, what does setting a pointer equal to NULL do? I know that NULL is just a #define 0, but does it just clear the address that the pointer points to? Or is there more? Thanks again for the help