You're inconsistent a bit. You use char*
and use std::string
s as well, std::string
has the benefit of having the size
method that you are using in the for loop. std::string
doesn't have std::string::size_t
, it's either size_t
or std::string::size_type
.
I'd replace your char*
parameters to const std::string&
, that way it works as you intended.