I get implicit declaration of function strncmp From the strncmp(3) man page: #include <string.h> Did you forget to #include <string.h>?