#include <stdio.h>
#include <string.h>
// char *strchr(const char *str, int c)
// search for the first occurrence of a character in a string
// return a pointer to the first occurrence of the character or NULL if the character is not found
int main(int argc, char **argv)
{
char s[] = "c programming";
puts(strchr(s, 'm'));
puts(strchr(s, 'x')); // NULL
if (strchr(s, 'p'))
printf("Exist\n");
else
printf("Not Exist\n");
return 0;
}
/*
run:
mming
Exist
*/