Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. char* whitespace(char* s)
  2. {
  3. int brojac = 0;
  4. char *pomocni = s, *pok1; /*pomocni pokazivac na pocetak stringa*/
  5. while(*pomocni != '\0')
  6. {
  7. if(*pomocni == '\n' || *pomocni == '\t' || *pomocni == ' ')
  8. {
  9. *pomocni++ = ' ';
  10. pok1 = pomocni;
  11. while(*pok1 == '\n' || *pok1 == '\t' || *pok1 == ' ')
  12. pok1++;
  13. while(*pok1 != '\0')
  14. {
  15. *pomocni++ = *pok1++;
  16. }
  17. *pomocni = *pok1;
  18. pomocni = s;
  19. continue;
  20. }
  21. pomocni++;
  22. }
  23. return s;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement