I need to write an implementation for search that steps through the string comparing each character wit the given character. If it finds a match, it will return a pointer to the current position. If it reaches the end of the string without finding a match, it will return a null pointer.

Can anyone help me do it?

Here is my code so far:#include <stdio.h>

char* search (char* s, int c) {

/*code here*/


}

int main () {
char quick_fox [] = "The quick brown fox jumps over the lazy dog.";
char c;
char* p;

c = 'x';
p = search(quick_fox, c);
if (p) {
printf("The substring that starts with %c is \"%s\"\n", c, p);
} else {
printf("No %c in \"%s\"\n", c, quick_fox);
}

c = 'X';
p = search(quick_fox, c);
if (p) {
printf("The substring that starts with %c is \"%s\"\n", c, p);
} else {
printf("No %c in \"%s\"\n", c, quick_fox);
}
}