use static_cast
Use size_t rather that unsigned long