/ Published in: C
usage: srch(foo, bar.txt)
Expand |
Embed | Plain Text
#include <stdlib.h> #include <stdio.h> #include <string.h> char srch(char *string_to_find, char *filename) { FILE *fp=fopen("M", "r"); char tmp[256]={0x0}; while(fp!=NULL && fgets(tmp, sizeof(tmp),fp)!=NULL) { if (strstr(tmp, string_to_find)) } if(fp!=NULL) fclose(fp); return tmp; }
You need to login to post a comment.
