Answering question # 2 -
Memory can by allocated dynamically using malloc, or new.

For the former, use free.
For the latter use delete, or delete [] if you allocated an array.