Mega Code Archive
Categories
/
C++
/
Data Type
Strcspn( ) function
#include
#include
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); }