J
John Salerno
All this time I've been using a string array for my program, but I think
I might want to actually use the values (0s and 1s) as integers, so is
there an easy way to convert this? Should it happen when the file (of 0s
and 1s) is being read into the array, or should I read it as a string
array first, and then convert it to int? I tried one thing, but it
didn't work:
StreamReader readSwitchValues = new StreamReader(path);
string[] completeFile = readSwitchValues.ReadToEnd().Split();
int[] allSwitchValues = Int32.Parse(completeFile);
readSwitchValues.Close();
I might want to actually use the values (0s and 1s) as integers, so is
there an easy way to convert this? Should it happen when the file (of 0s
and 1s) is being read into the array, or should I read it as a string
array first, and then convert it to int? I tried one thing, but it
didn't work:
StreamReader readSwitchValues = new StreamReader(path);
string[] completeFile = readSwitchValues.ReadToEnd().Split();
int[] allSwitchValues = Int32.Parse(completeFile);
readSwitchValues.Close();