code for copy array element with pointer etc