Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <stdio.h>
#include <stdlib.h>
int main () {
FILE * pFile;
long lSize;
char * buffer;
char szSearchString[] = "sample"
pFile = fopen ( "myfile.txt" , "rb" );
if (pFile==NULL) exit (1);
// obtain file size.
fseek (pFile , 0 , SEEK_END);
lSize = ftell (pFile);
rewind (pFile);
// allocate memory to contain the whole file.
buffer = (char*) malloc (lSize);
if (buffer == NULL) exit (2);
// copy the file into the buffer.
fread (buffer,1,lSize,pFile);
/*** the whole file is loaded in the buffer. ***/
if (strstr (str,szSearchString) != NULL)
{
//do some processing
}
// terminate
fclose (pFile);
free (buffer);
return 0;
}