1. 程式人生 > >陣列練習2

陣列練習2

2018/12/6

將一個字元陣列的值(neusofteducation)拷貝到另一個字元陣列中。

char[] arr = {'n','e','u','s','o','f','t','e','d','c','a','t','i','o','n'};
		char[] ar = new char[16];
		for(int i=0;i<arr.length;i++){
			ar[i]=arr[i];
		}
		for(char n:ar){
		System.out.print(n+" ");
		}