title: Segmentation Fault with Pointers in C++
body: <p>I am trying to build an object of a struct but am getting a segmentation fault while assigning the values. After I build the object it will be passed by pointer into a list. Here is my implementation:</p>
  
  <pre><code>struct clientInfo {
    int client, a, b;
  };
  List *info=new List();
  
  void thread(int which) {
    clientInfo *cI;
    cI-&gt;client=which;
    cI-&gt;a=4;
    cI-&gt;b=5;
    info-&gt;Append(cI);
  }
  </code></pre>
  
  <p>During the execution of 'cI->client=which' a segmentation fault is produced. This project is being writting on the nachos platform for anyone that is familiar, however the definition of List is much the same as any linked list in C++. For anyone not familiar with nachos, 'void thread' is my 'int main'.</p>
  
  <p>Thanks in advance.</p>