#include <string.h> #include <stdio.h> int main(void) { char str[17]; char *ptr; strcpy(str, "This is a string"); ptr = memchr(str, 'r', strlen(str)); if (ptr) printf("The character 'r' is at position: %d\n", ptr - str); else printf("The character was not found\n"); return 0; }