Char 2 dimensional

nonick

New Member
\[code\] public static void main(String[] args) { Scanner s= new Scanner(System.in); String m ; char cur; String k; System.out.print("enetr the text "); m=s.next(); System.out.print("enetr the key: "); k=s.next(); char d[][]= new char [m.length()][k.length()]; for(int i=0;i<1;i++){ for(int j=0;j<k.length();j++){ cur=k.charAt(j); System.out.print(""+cur); d[0][j]=cur; System.out.print(d); }}\[/code\]I want to help in this code The idea of ??this code: I want to copy a sentence in a 2 dimensional array and the size of the matrix is ??
the same length as sentence, for example:\[code\]if k =jon \[/code\]\[quote\] D[0][0]=J D[0][1]=O D[0][2]=N\[/quote\]
 
Back
Top