I need a function that searches the text for a pattern. Report all occurrences of a string...
i write this function but it doesn't work..
thank you for alll
Code:void Search(char fileName[],char array[]) { char search[LENGTH]; int i,m,n; printf("please enter a string:\n"); gets(search); printf("enter the start point and length:"); scanf("%d%d",&m,&n); for(i=m;i<n;i++) { if(search[i]==array[i]) {printf("%s", array[i]);} else {} } system("PAUSE"); printf("\n\n"); fflush(stdin); }