Advertisement
Guest User

Untitled

a guest
Jan 8th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #define SIZE 21
  2.  
  3. int main(void)
  4. {
  5. setlocale(LC_ALL, "Rus");
  6.  
  7. char word[SIZE];
  8.  
  9. s_gets(word, SIZE);
  10. printf("Массив записан\n");
  11. printf("%p %c\n", word, *word);
  12. res = spaces(word, SIZE);
  13. printf("\n");
  14. fputs(res, stdout);
  15.  
  16. printf("\n");
  17.  
  18. return 0;
  19. }
  20.  
  21. char *spaces(char *st, int n)
  22. {
  23. printf("Выполнен вход в space()");
  24. char *ch;
  25. int i;
  26. printf("%c", *st);
  27. ch = strchr(st, ' ');
  28. for(i = 0;i < n || st[i] == '\0';i++)
  29. {
  30. if(st[i] == ' ')
  31. {
  32. ch = st[i];
  33. }
  34. }
  35. return ch;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement