fork(72) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char* s = "some/very/big/string";
  6. char *last = strrchr(s, '/');
  7. if (last != NULL) {
  8. printf("Last token: '%s'\n", last+1);
  9. }
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
Last token: 'string'