Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sprpoczatek(char *buf, char* slowo){
- int h=strlen(slowo);
- for(int i=0; i<h; i++)
- if(buf[i]!=slowo[i])
- return 0;
- if(buf[strlen(slowo)]!=' ')
- return 0;
- return 1;
- }
- int sprkoniec( char* buf, char*slowo){
- if(strlen(buf)>1){
- if((buf[strlen(buf) - strlen(slowo)-1])!=' '){
- printf("%c\n", buf[1]);
- return 0;
- }
- for(int i=0; i<(strlen(buf) - strlen(slowo)); i++)
- if(buf[strlen(buf)+i-strlen(slowo)] != slowo[i])
- return 0;
- }
- return 1;
- }
- char *case1 = malloc(sizeof(char) * (strlen(skorowidz.slowa[i])+3));
- char *case2 = malloc(sizeof(char) * (strlen(skorowidz.slowa[i])+3));
- strcpy(case1, " ");
- strcpy(case1, skorowidz.slowa[i]);
- strcat(case1, " ");
- char *temp_copy = skorowidz.slowa[i];
- if( (strstr( buf, case1 ) != NULL) || (sprpoczatek(buf,skorowidz.slowa[i]) == 1) /*|| (sprkoniec(buf, skorowidz.slowa[i])==1)*/)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement