Mega Code Archive

 
Categories / C++ / Data Type
 

Strcspn( ) function

#include <stdio.h> #include <string.h> char s1[35]; int answer; int main( ) {  strcpy(s1,"We are looking for great strings." );  answer=strcspn(s1,"abc");  printf("The first a,b,c appeared at position %d\n",answer+1);  return (0); }