For example, how can I write a function like this:
int countChar(std::string str);
to count the number of chars in the str? I can't use any of the methods in std::string class, like str[i] != '\0'; or str.length().
str[i] != '\0';
str.length()
Thanks!
Aucun commentaire:
Enregistrer un commentaire