fork download
  1. #include <stdio.h>
  2.  
  3. int dlugosc_stringa(char *str) {
  4. int result = 0;
  5.  
  6. while(*str) {
  7. str++;
  8. result++;
  9. }
  10.  
  11. return result;
  12. }
  13.  
  14. int main(void) {
  15. char *test = "to jest test";
  16. printf("Dlugosc testu [%s] = %d\n", test, dlugosc_stringa(test));
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 4364KB
stdin
Standard input is empty
stdout
Dlugosc testu [to jest test] = 12