String length · Comprimento de string
String length
A C-string is a row of characters that ends with a hidden null terminator. Return how many characters come before it — basically writing strlen yourself. Walk an index forward until you reach the terminator, counting as you go.
Comprimento da string
Uma string C é uma fileira de caracteres terminada por um nulo oculto. Retorne quantos caracteres vêm antes dele — basicamente escrevendo strlen você mesmo. Percorra um índice para frente até atingir o terminador, contando conforme avança.
Complete int str_len(const char *s) to return the length of the C-string s, without using strlen. Count characters until the null terminator. · Complete int str_len(const char *s) para retornar o comprimento da string C s, sem usar strlen. Conte caracteres até o terminador nulo.
Click Run to see the output here. · Clique em Executar para ver a saída aqui.