I'm not going to give you a code answer. Not least because I don't have a C++ IDE handy to syntax check it.
However the question you pose has quite a few facets to it.
* Encapsulation. Private/protected member variables with (or without) getter/setter functions.
* Initialisation and construction/destruction. You can use constructor cascading and/or constructors with initializers.
* Memory allocation. When given a "code" or "price", are they by value or by pointer? Who owns the memory? [1]
* Destructor. If you are allocating the memory inside the class (copy or by value), you will need to deallocate it in the destructor.
* Copy constructor. Again if use internal values. Otherwise you just copy the pointer to the same value.
[1] In all most all languages which use pointers/references true encapsulation is only available if you use by-value or copy mechanics and have the class own the memory. Technically, this is most often ignored and "getter" functions will happily return pointer to a private member. Of course, if you have a pointer to the memory, it's fairly trivial to modify it regardless of the class protections. Thus, if you want proper mutability protection from encapsulation you will need to consider public, shared and private pointers and the management of. It would depend on the level you are expected to be at as to whether this discussion on true internal encapsulation is required or not.