#include <string.h>
main()
{
char *s="Golden Global View";
char *r="new";
int n;
//clrscr();
n=strcspn(s,r);
printf("The first char both in s1 and s2 is: %c %d",s[n],n);
getchar();
return 0;
}
结果:
The first char both in s1 and s2 is: e 4