I am a senior Comp Sci major about to enter my last semester where I will be taking just one class involving only the language C. I was attempting to practice my skills by making a rather simple program that I conceived of. I simply want to read a single file, put its entire contents into an array, and then traverse this array looking for a sequence of characters that spells out "Waldo".  In other words, a sort of Where's Waldo? program.
I have not gotten into coding the "Waldo" search with the array yet, but instead, I simply just wanted to test my use of the getc() function and output the input file's contents, but with the source code I have so far, I only receiving incorrect outputs of seemingly gibberish (probably having to do with the way I am incorrectly utilizing the getc() return value).
Maybe I should not be using getc() and instead be using a scanf() type function?  Also, I very much am trying to master the by-reference pointer-notation when inserting into and printing out the array here, so I would like to avoid referring to array elements using bracket notations (by-value).  Admittedly so, I may not have the most complete understanding of pointers.
#include <stdio.h>
#include <stdlib.h>
void main( int argc, char *argv[] )
{
    FILE *filePointer;
    int filechar, i; 
    char input_file_array[512];
    char *arrayPointer = input_file_array;
    filePointer = fopen( argv[1], "r" );
    if ( argc > 2 || ( filePointer = fopen( argv[1], "r" ) ) == NULL )
    {
        printf( "\nIncorrect usage, please say...\nRunWaldo *filename*\n\n" );
        exit( 1 );
    }
    if ( filePointer != NULL )
    {    
        while ( !feof( filePointer ) )
        {
            *arrayPointer = getc( filePointer );
            arrayPointer++;
        }
    for ( i = 0; i < 512; i++ )
    {
        printf( "%c", *(arrayPointer + i) );
    }
    printf("\n");
}

 
     
     
    