0

C#: Does anyone know the code to writing an array from the text file? If it's okay to ask.

text line 1: 12 Julia 1992 for the arrays, I have int[] ID = new int [3]; string[] name = new string[3]; int[] year = new int [3]; What C# codes do I use to register ID [0] as 3, name [0] as Julia and year [0] as 1992?

12th May 2018, 2:06 AM
Luis
Luis - avatar
1 Answer
+ 2
one way to solve this is to declare a class (person for example ) and create an list of persons : class Person { int id; string name; int year; } List<Person> persons=new List<Person>;
12th May 2018, 10:55 AM
Rabee Abbas
Rabee Abbas - avatar