it's not good way use implicit type casting. Use static_cast or declare k like size_t