CodePudding user response:
int find_substr_first_pos (const char * STR, const char * substr)
{
Const char * PSTR=STR;
Int I=0, pos=1;
While (PSTR [I]) {
If (STRNCMP (PSTR + I, substr, strlen substr ())==0) {
Pos=I;
break;
}
}
Return pos.
}
For your reference ~
No test, it is recommended that the landlord to call it and test it
CodePudding user response:
Thank you but I am a beginner, these seem to be haven't learned