Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. int func(char *ss)
  2. {
  3. int cnt;
  4. char i = 0;
  5. char *s = (char *)ss;
  6. cnt= 0;
  7. for (i; i <= strlen(s); i++ );
  8. {
  9. if ( isspace(s[i]) )
  10. memcpy(&s[i+1], s+i+1, strlen(s)-i);
  11. cnt = cnt + 1;
  12. }
  13. return cnt;
  14. }
  15.  
  16. void main()
  17. {
  18. int x = func("Hi !");
  19. printf("%d\n", x);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement