title: Writing to a file(fprintf)
body: <p>Im trying to add some bindings to ARP table in Linux, in C. Im opening a file with "a" (append, right?) and then trying to write some addresses, but I always get segmentation fault. I believe there is something wrong with <code>ARP_table[i].IPaddr, ARP_table[i].MACaddr, ARP_table[i].ARPstatus</code></p>
  
  <pre><code>struct ARP_entry 
  {
    char IPaddr[16];
    char MACaddr[18];
    char ARPstatus;
    int timec;
  };
  
  static struct ARP_entry ARP_table[ARP_table_vel];
  
  void copyZIS()
  {
    int i=0;
    const char filename[] = "/proc/net/arp";
    FILE *file = fopen(filename, "a");
  
  
    for (i; i&lt; i+j; i++)
    {
       fprintf(file, "%c %c %c", ARP_table[i].IPaddr, ARP_table[i].MACaddr, ARP_table[i].ARPstatus);
    }
  
  }
  </code></pre>