use unsafe to iterate and memcopy for char string copy