I new to C. I am reading a find-replace algorithm for C and I am a bit confused what the - & + operators do in this code:
-
+
char *re
it is a simple pointer arithmetics.
buffer + i is the substring of buffer, that starts from the ith character [until the end]
buffer + i
buffer
i
p - src is giving you the offset between p to src.
p - src
p
src