int :: cadena calculatelenght(const cadena& a, const char* cad)
{
cadena c;
int lenght = 0;
char* punt; punt = cad;
while(*punt){
lenght++; punt++;
}
return lenght;
}
I have this problem, I want to calculate the length of a C string without using functions like strlen, in other methods of my cadena class I can because is not const char*, but now I don’t know what to do.
You can declare
puntto be of the correct type: