I just started learning C++ and I'm used to Java paradigms, so I'm not sure how this should be done:
I need to represent a vector of products of two different types: **packaged** and **fresh food**. They have some **common fields** with a single implementation (availability, re-stock quantity etc), but they have also **different fields and functions** with different return types. 

> 
> I.E: fresh foods may have a boolean field needsRefrigeration, other
>  products may have an integer representing a category (food, cleaning,
>  bricolage, forniture...).
> 
> 
> 

In Java I would create a Product object with the common fields and a PackagedProduct (extending Product) plus a FreshProduct (also extending Product) with their particular fields. Then I'd place every product in a vector and accessed as Product when I need the common fields, safely-casted (with instanceof) to the right class when I need to access the child's fields.
I know this is not the right way in C++ and I don't want to force java programming paradigms to C++. 

I can imagine:

* create all the functions required by all the cildren as virtual in the parent and add a field in the parent representing the type of the cild, so it can safely casted
* create a wrapper object containing two different vectors, each one of the type of a child object and return the values in the correct order, eventually using a third int vector.

I think these solutions are really bad, and I'm almost sure there must be a better way, but I can't imagine it. Can you help me?
What's the right way to do this?