The following example searches for the character `x' in the string "Example string".
char * p;
char str = "Example string";
p = (char *)memchr(str, 'x', strlen(str));
lr_output_message ("Character x is at position %d\n", p - str + 1);
lr_output_message ("Character x was not found");
Character x is at position 2