Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- [...]
- /*
- Função para contar o tamanho da string
- char *string String a ter seu tamanho contado
- Retorno tamanho da string
- */
- int contarTamanho(char *string){
- int tamanho=0;
- int i=0;
- while(string[i]!='\0' && i < strlen(string)){
- if(string[i]==' '){
- string[i]='\0';
- }
- tamanho++;
- i++;
- }
- return tamanho;
- }
Advertisement
Add Comment
Please, Sign In to add comment