title: C Readline Function Not Working
body: <p>I'm reading the <em>BigNerdRanch book on Objective-C</em> and it's running me through how to take lines into <code>stdin</code> in regular C. For some reason, the example code that's supposed to run with <code>readline</code> duplicating input (small bug) is not functioning. It builds successfully but after taking input in which if I type <code>Mikey</code> it displays <code>MMiikkeeyy</code>, </p>
  
  <p>I get:</p>
  
  <pre><code>(lldb) IMPLICIT DECLARATION OF FUNCTION READLINE IS Thread1:EXC_BAD_ACCESS(code=1,address=0x20000)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, const char * argv[])
  {
      printf("Who is cool? ");
      const char *name = readline(NULL);
      printf("%s is cool!\n\n", name);
      return 0;
  }
  </code></pre>
  
  <p>Any help is much appreciated.</p>