[[C++]] add constructor and destructor.

add constructor and destructor.
also fixed some syntax.