title: Using GDB to find what memory address a function corresponds to/ debugging
body: <p>I have this basic program:</p>
  
  <pre><code>int initfunc(int *array, int len) {
    int i;
    for(i=1; i &lt;= len; i++) {
      array[i] = i;
    }
   return 0;
  }
  
  int main(int argc, char* argv[]){
  
    int*  myarray=0;
    initfunc(myarray,10);
  }
  </code></pre>
  
  <p>First i'm trying to figure out what the command in GDB to find what memory address main is stored in.</p>
  
  <p>And also my error is at line 4 (array[i] = i), i'm trying to figure out what I need to do to get it to run. My professor wrote this program so I get that using these pointers probably isn't a good way to code this basic program. I just need some insight since i'm not too great with pointers. </p>