For example I have:
char buff[1000];
I want to search if the string “hassasin” is in that char array. Here is what I have tried.
char word[8] = "hassasin";
char Buffer[1000]=sdfhksfhkasd/./.fjka(hassasin)hdkjfakjsdfhkksjdfhkjh....etc
int k=0;
int t=0;
int len=0;
int sor=0;
for (k=0; k<1000; k++){
for (t=0; t<8; t++){
if (Buffer[k]==word[t]) len++;
if (len==8) "it founds 0.9.1"
}
}
if the chararray contains stringend or do not end with \0 you can use these code, because strstr will brake on these ones:
http://ideone.com/2In3mr