title: Updating a C array while reading an input file
body: <p>I am now using cython to read an input file, convert the string to int and store them in a c array (instead of a list) to save space. The code I have looks like this:</p>
  
  <pre><code>cdef long p[10000000]
  cdef long i
  i = 0
  f = open(filename, 'r')
  for line in f:
      temp = map(int, line.split())
      p[i] = temp[0]
      i = i + 1
  f.close()
  </code></pre>
  
  <p>However, the program is always aborted when I refer to the array p. Somehow the array is not "defined" as the memory usage is very low. It works, however, if I'm doing</p>
  
  <pre><code>cdef i
  for i in range(0, 1000):
      p[i] = i
  </code></pre>