title: How do I access a ruby array from my c extension?
body: <p>I'm getting this error</p>
  
  <pre><code>ev.c:11: error: subscripted value is neither array nor pointer
  </code></pre>
  
  <p>for this line</p>
  
  <pre><code>printf("%d\n", pairs[0][0]);
  </code></pre>
  
  <p>In this code</p>
  
  <pre><code>static VALUE EV;
  static VALUE PairCounter;
  
  static VALUE 
  sort_pairs_2(VALUE self) {
      VALUE pairs;
  
      pairs = rb_ivar_get(self, rb_intern("pairs"));
      printf("%d\n", pairs[0][0]);
    return Qnil;
  }
  
  void Init_ev() {
      rb_eval_string("require './lib/ev/pair_counter'");
      VALUE PairCounter = rb_path2class("EV::PairCounter");
      rb_define_method(PairCounter, "sort_pairs_2", sort_pairs_2, 0);
  }
  </code></pre>
  
  <p>Am I using self incorrectly, and rb_ivar_get is not actually pointing to the PairCounter class?</p>