c# - want to move each array from arrayList into int [ ] -


there 350 elements in arraylist , each of consist of array of 9 integers i-e count of each element 9 . want retrievere each of it.
here trying giving me error

"unable cast object of type 'system.collections.generic.list`1[system.int32]' type 'system.int32[]'."

filename = "e:\\normalized_sheet1.txt"; filestream fs = file.openread(filename); streamreader sr = new streamreader(fs);   while (!sr.endofstream) {     line = sr.readline().split('\t');  //make array of text each time     list<string> arr = new list<string>();     arr.addrange(line);    list<int> intlist = arr.convertall(s => int32.parse(s));     myvalues.add(intlist);  }  sr.close(); fs.close();  (i = 0; < samples; i++) {     inputparameter=(int[]) myvalues[i];     // error } 

myvalues.add(intlist.toarray()); 

because mentioned have list of arrays. if it's list<int[]> can't add lists - can add arrays. toarray() returns array of items in list.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -