Hi all!
This code should work, but it doesn't:
When I try to compile it I get this:Code:#include <stdio.h> int main(void) { char *pos; char buf[100]; FILE *fp; fp = fopen("text.txt","r"); fgets(buf, 100, fp); pos = strchr(buf, '~'); if (pos){ printf("Character '~' found at position %d.\n", pos - buf); } fclose(fp); return 0; }
warning: incompatible implicit declaration of built-in function 'strchr'.
What's wrong with the code?
Thanks in advance for help