Oui, t'as pas initialisé ton tableau. Tu le déclares mais tu ne l'initialises pas.
Donc pour que ça marche, il faudrait écrire juste avant ton for : matrix = new char[40]; (puisqu'apparemment tu veux une longueur de 40).
Pour info, un tableau en Java c'est considéré comme un objet (j'ai appris ça y a pas très longtemps, surtout passke j'faisais pas gaffe ?3 ce que j'écrivais ) donc il faut l'initialiser avec un new. De plus, tu as aussi accès au nombre d'éléments du tableau avec le champ length que tu appelles en faisant matrix.length.
Vala. Mate un peu la doc de Java avant de te lancer direct dans la prog : http://developer.java.sun.com/deve [...] /new2java/
EDIT : http://java.sun.com/docs/books/jls [...] C.doc.html c'est bien aussi
Message édité par Taiche le 19-03-2003 à 14:31:29
---------------
Everyone thinks of changing the world, but no one thinks of changing himself | It is the peculiar quality of a fool to perceive the faults of others and to forget his own | Early clumsiness is not a verdict, it’s an essential ingredient.