CMyClass *pmyClass = new CMyClass;

new creates the object on the heap, so it isn't destroyed when the object leaves scope. That is useful in a lot of situations. (But I won't list them now)