array length to const, use g++ replace vs