Tuesday, 15 March 2011

After split string from a line with 2 string array returned 1 element, so array is out of bounds when accessing array[1] -


I am trying to solve this problem.

  while (readSiteid-> Peek)! = -1) {string ^ OneLine = (readSiteid-> readline ()); If (forestline! = Nullptr) {array & lt; String ^ & gt; ^ Results = One-Line-> Split (''); String ^ first = result [0]; String ^ sec = result [1];  

After the compilation the array is ejected out of range. I did further testing with MessageBox :: Show (Results [1]); Nothing got even if only the result reached [0] (the result of the comment [1]) is no problem.

Why is the index only 1 wrong?


No comments:

Post a Comment