I'm reading the BigNerdRanch book on Objective-C and it's running me through how to take lines into stdin
in regular C. For some reason, the example code that's supposed to run with readline
duplicating input (small bug) is not functioning. It builds successfully but after taking input in which if I type Mikey
it displays MMiikkeeyy
,
I get:
(lldb) IMPLICIT DECLARATION OF FUNCTION READLINE IS Thread1:EXC_BAD_ACCESS(code=1,address=0x20000)
Code:
#include <stdio.h>
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;
}
Any help is much appreciated.