by CountHackulus · 16y ago · 0 comments
Simply, you can subtract pointers. Let's say you're walking a string from the front and from the back at the same time, and want to find the length of the substring. Well, you don't have to use indeces, just do this:
int len = back_ptr - front_ptr;
You'd be surprised how often this crops up when you're using lots of pointer tricks.No comments yet.