Created
October 8, 2019 19:57
-
-
Save enzobonggio/07ea56d0176a99841a8210884858b068 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int strSub(char *cadena,char *subcadena) | |
{ | |
int i=0, ii, R=0; | |
while(cadena[i]!='\0'&& R==0) | |
{ | |
if (cadena[i]==subcadena[0]) | |
{ | |
ii=0; | |
int I=i; | |
while(cadena[I]==subcadena[ii]&&cadena[I]!='\0') | |
{ | |
ii++; | |
I++; | |
} | |
if (subcadena[ii]=='\0') | |
{ | |
R=i; | |
} | |
} | |
i++; | |
} | |
R=-1; | |
return R; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment