Those are not parenthesis, but braces, so they make up a block of code. Thus, the second hStr (declared as it is) would be a different pointer which exists inside this block.
If you ommit char* inside this block, you would be referring to the hStr above.
I'm under the expression that using delete [] hStr deletes the memory pointed to by hStr, and hStr handle doesn't get deleted till it goes out of scope. |
I'm not sure of what you express here, but memory is not deleted, it gets freed by using delete[] hStr. If you get out of scope without freeing the memory with delete, you will get memory leaks.
If, on the other hand, what you want is to reuse the first hStr and assign new memory to it, you must use delete [] first.
Edit:
You need 1 delete for 1 new. If you miss 1, you get a memory leak.
regards,
Alejandro