fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char texto[50];
  6. printf("\nInforme seu nome completo: ");
  7. fgets(texto, 50, stdin);
  8. int cont = strlen(texto);
  9. printf("\nO tamanho da string: %i\n", cont);
  10. for (int i = 0; i < cont; i++) printf("%d ", texto[i]);
  11. texto[cont - 1] = '\0';
  12. cont = strlen(texto);
  13. printf("\nO tamanho da string: %i\n", cont);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/157168/101
Success #stdin #stdout 0s 4144KB
stdin
Over
stdout
Informe seu nome completo: 
O tamanho da string: 5
79 118 101 114 10 
O tamanho da string: 4