Advertisement
Guest User

WO JE TUT TAKOE?????????

a guest
Nov 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. char *Tokenizer::toString()
  2. {
  3. char *res = new char[buffer.length()];
  4. int i = 0;
  5. bool isEscape = false;
  6. for (char j : buffer)
  7. {
  8. if (j == '"' && !isEscape)
  9. continue;
  10. if (j == '\\' && !isEscape)
  11. {
  12. isEscape = true;
  13. continue;
  14. }
  15. res[i++] = isEscape ? toEscape(j) : j;
  16. if (isEscape) isEscape = false;
  17. }
  18. res[i++] = '\0';
  19. return res;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement