[fix #22] Modify default C++ template to instantiate classes on heap

To prevent stackoverflow error when creating an object,
each problem instance should be created on heap rather on stack.
The default C++ test code template is modified to fix this.
Merge pull request #22 from wookayin/cpp-heap

Modify default C++ template to instantiate classes on heap