Facebook
From Gentle Bird, 7 Years ago, written in Plain Text.
">

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 33

from

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 33

- view diff
Embed
Download Paste or View Raw
Hits: 448
  1.  //=
  2.  string path = @"../kwadraty.txt";
  3.             Console.WriteLine("a");
  4.             int a = Convert.ToInt32(Console.ReadLine());
  5.             Console.WriteLine("b");
  6.             int b = Convert.ToInt32(Console.ReadLine());
  7.             StreamWriter sw = new StreamWriter(path);
  8.             for (int i = a; i <= b; i++)
  9.                 sw.WriteLine(string.Format("{0};{1}", i, i * i));
  10.             sw.Close();
  11.             string linia;
  12.             string[] wartosci;
  13.             StreamReader sr = new StreamReader(path);
  14.             while ((linia = sr.ReadLine()) != null)
  15.             {
  16.                 wartosci = linia.Split(';');
  17.                 Console.WriteLine("Kwadrat {0} wynosi {1}", wartosci[0], wartosci[1]);
  18.             }
  19.             sr.Close();