Read file directly - simplified In order to read a whole file as a string using standard libraries you have to allocate memory, terminate the string, determine size of the file and size of each element.
This could happen with fread until I decided to automatize it using this:

char *readFile (FILE* fp, char *source)
{
    unsigned long long int size;
    unsigned long long int i = 0;
    int chr;

    fseek(fp, 0L, SEEK_END);
    size = ftell(fp);

    source = calloc(size + 1, sizeof(char));

    fseek(fp, 0, SEEK_SET); // rewind

    while(chr != EOF)
        source[i++] = (chr = fgetc(fp));

    source[size] = '\0';    // Terminate string

    return(source);
}
You let the user pass in a char* but you don't use it. you might as well remove it and declare it as a local variable.

char *readFile (FILE* fp)
{
    char* source;


Some FILE* won't let you seek to the end (stdin and socket streams for example). You should check the return value of fseek and fall back to the classic fread then realloc, rinse and repeat method on error.

A single fread is more efficient than the repeated fgetc; so you can replace the while with:

int readBytes = fread(source, size, 1, fp);

string[readBytes] = '\0';