Is this the proper way of freeing Pointer Memory in c++
<p>this is a example, I am struck with whether it is a a proper way of freeing the pointer assigned memory</p>

<pre><code>char* functionTest()  
{  
    char *a = new char[10];  
    return a;  
}  
int main()  
{  
    char *b;  
    b=functionTest();  
    delete[] b;  
    return 0;  
}
</code></pre>

<p>This is a very beginner question but still would like to clear my doubt.
edited from delete to delete[] thanks @sharptooth.
thanks in advance.</p>
