fork download
  1. // длина строки
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. char str[100]="";
  7. int size_t, N;
  8. printf("Введите строку:\n");
  9. gets(str);
  10. //printf("Вы ввели: ");
  11. //puts(str);
  12. N = strlen(str);
  13. printf("%d", N);
  14. MyStrLen (str);
  15. }
  16. MyStrLen (char const *stroka) {
  17. int i, n=0;
  18. for ( i = 0; stroka[i] != '\0' ; i++ ){
  19. n++;
  20. }
  21. printf("%d", n);
  22. }
  23.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
Введите строку:
00