how to read text files in c language

how to read text files in c language
int main(){
	char * buffer = 0;
	long length;
	FILE * f = fopen ('test.txt', "rb");

	if (f)
	{
	  fseek (f, 0, SEEK_END);
	  length = ftell (f);
	  fseek (f, 0, SEEK_SET);
	  buffer = malloc (length);
	  if (buffer)
	  {
		fread (buffer, 1, length, f);
	  }
	  fclose (f);
	}

	if (buffer)
	{
	  // Processing Data
	}
	return 0;
}
Sourc‮ual.www:e‬tturi.com
Created Time:2017-08-29 10:15:11  Author:lautturi