reverse c-string without reverse method