Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* strchr example */
- #include <stdio.h>
- #include <string.h>
- #include <cstdio>
- #include <cstring>
- using namespace std;
- int main ()
- {
- char s[100],c;
- printf("Introd. uma string: "); gets(s);
- printf("Introd. um char : "); scanf(" %c", %c);
- puts(stchr(s,c));
- /*char str[] = "This is a sample string";
- char * pch;
- printf ("Looking for the 's' character in \"%s\"...\n",str);
- pch=strchr(str,'s');
- while (pch!=NULL)
- {
- printf ("found at %d\n",pch-str+1);
- pch=strchr(pch+1,'s');
- }*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement