fork download
  1. #include <stdio.h>
  2.  
  3. char *es_token(char *s, char c)
  4. {
  5. int i = 0;
  6. while(s[i] != '#'){
  7. if (s[i] == c){
  8. s[i] = '#';
  9. return &s[i+1];
  10. }
  11. else{
  12. i++;
  13. }
  14. }
  15.  
  16. return (char*)(s);
  17. }
  18.  
  19. int main(void) {
  20. char text[] = "brown?fox#";
  21. char *tmp = es_token(text, '?');
  22. printf("%s\n", text);
  23. printf("%s\n", tmp);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
brown#fox#
fox#