#include <stdio.h>
#include <stdlib.h>
static char *
FileReadAsString(char *FileName)
{
char *Result = 0;
FILE *File;
File = fopen(FileName, "r");
int FileSize;
if(File)
{
fseek(File,0,SEEK_END);
FileSize = ftell(File);
rewind(File);
printf("file: %zi\n",FileSize); // Causes error
Result = (char *)malloc(FileSize + 1);
fread(Result, 1, sizeof(*File) , File);
//fread(Result, sizeof(*File), 1, File); // handmade hero style
Result[FileSize] = 0;
fclose(File);
}
//File = fopen("some.txt","w");
//fwrite(Result, 1, FileSize, File);
return Result;
}
int
main()
{
char *String;
String = FileReadAsString("apple.txt");
printf(String);
}
#include <stdio.h>
struct eple
{
int a;
int b;
};
/* eple */
// ep
int
main()
{
return 0;
}