length() probably returns size_t or unsigned long and you are comparing it with signed long.
Change
long lDelFront = 0, lDelBack = 0;
to
size_t lDelFront = 0;
size_t lDelBack = 0;
to avoid signed/unsigned comparison
1
solved warning C4018: ‘<' : signed/unsigned mismatch