Two Pointer Problems In C