Finding characters in a sentence : <p>I want to make a program that can find characters in long string...
.
.</p>

<pre><code>int i = 0;
char buf[100];
char ch[10];
char *res;
int len = 0;
int j = 0;

printf("Enter characters: ");
while(1){
    j = getchar();
    if(j == '\n') break;
    ch[i++] = j;
}
ch[i] = '\0';

while(len &lt; 1){
    printf("Enter a sentence: ");
    res = fgets(buf, 200, stdin);
    len = strlen(buf);
}
</code></pre>

<p>Here's sample execute screen.</p>

<p>Enter characters: mkn</p>

<p>Enter a sentence: My son is in elementary school.</p>

<p>Finding..</p>

<p>-
My
son
in</p>

<h2>elementary</h2>

<p>I want to make this program with strtok() and strchr()... but I am confused with pointers....</p>
