I'm taking a C class for the fun of it. I figured I wanted to learn a little more of the history of the C/C++ language. Anyways I've run into a bit of a compiling problem. I'm using MSVC++6 and the following code 'will' compile as a .cpp file, but not as a .c file. I know the compiler handles the two a little differently. I haven't been able to find any configuration settings that my be giving me trouble, but if any of you guys had suggestions or could point out if something wouldn't be considered "c" that would be most appreciated.

On that note, I was interested in learning how to insert 'preamble code' (correct terminology?). I tried searching through this nifty site and was not able to find anything about doing that. Thank you in advance!

Code:
//============================================================================
// File: MinMax.c
// ============================================================================
// Programmer: Michael Croghan
// Date: 01/26/2003
// Class: CSCI 223 ("C for Math and Science")
// Time: TR 4:00PM - 5:50PM
// Instructor: Mr. Edwards
// Project: MinMax
//
// Description:
//      Program to read integers and display the minimum and maximum values 
//		encountered. See the Announcements page for more details.
// ============================================================================

// INCLUDES ///////////////////////////////////////////////////////////////////
#include <stdio.h>
///////////////////////////////////////////////////////////////////////////////

// DEFINES & TYPEDEFS /////////////////////////////////////////////////////////
// Message to prompt user //
#define PRMPT_MSG "Enter an integer (push ctrl-z followed by enter to stop):\t"

// Declare NumberTracker //
struct NumberTracker;
// Function pointers for struct NumberTracker //
typedef void (* constFunc)(NumberTracker &_numTracker);
typedef int (* readFunc)(NumberTracker &_numTracker);
typedef void (* compFunc)(NumberTracker &_numTracker);
///////////////////////////////////////////////////////////////////////////////

// STRUCTS ////////////////////////////////////////////////////////////////////
// Purpose is to read user input and process user input //
struct NumberTracker
{
	signed int currentValue;
	signed int *maxValue;
	signed int *minValue;

	constFunc NumberTrackerConstructor;
	readFunc ReadInput;
	compFunc CompareInput;
};
///////////////////////////////////////////////////////////////////////////////

// FUNCTION DECLARATIONS //////////////////////////////////////////////////////
void ConstructNumberTracker (NumberTracker &_numTracker);
int ReadValue (NumberTracker &_numTracker);
void CompareValue (NumberTracker &_numTracker);
///////////////////////////////////////////////////////////////////////////////

// ==== main ==================================================================
//
// ============================================================================
int main (void)
{
	// Create NumberTracker; assign appropriate function pointers //
	NumberTracker numberTracker;
	numberTracker.NumberTrackerConstructor = &ConstructNumberTracker;
	numberTracker.ReadInput = &ReadValue;
	numberTracker.CompareInput = &CompareValue;
	// Call NumberTracker constructor function //
	numberTracker.NumberTrackerConstructor (numberTracker);

	// Result value of input read //
	auto int result = 0;

	// Main loop //
	for (;;)
		{
		printf (PRMPT_MSG);
		
		// Get result of input //
		result = numberTracker.ReadInput (numberTracker);

		// Check if result is EOF //
		if (result != EOF)
			{
			// Verify result is good //
			if (result)
				{
				// Compare current input //
				numberTracker.CompareInput (numberTracker);
				}
			}
		// result is EOF, end program
		else
			{
			break;
			}
		}

	// Print final results to screen //
	printf ("Max integer value entered:\t%i\nMin integer value entered:\t%i\n",
			*numberTracker.maxValue, *numberTracker.minValue);

	return 0;
}

// FUNCTION DEFINITIONS ///////////////////////////////////////////////////////
// ==== ConstructNumberTracker ================================================
//
// Assigns default values to a NumberTracker struct.
//
// Input:
//      _numTracker    -- reference to a NumberTracker struct.
//
// Output:
//      No output.
//
// ============================================================================
void ConstructNumberTracker (NumberTracker &_numTracker)
{
	_numTracker.currentValue = 0;
	_numTracker.maxValue = NULL;
	_numTracker.minValue = NULL;
}

// ==== ReadValue =============================================================
//
// Reads input from user.  If an EOF is detected (ctrl-z), method returns EOF
// otherwise assigns user input the currentValue in the NumberTracker passed.
//
// Input:
//      _numTracker    -- reference to a NumberTracker struct.
//
// Output:
//      No output.
//
// ============================================================================
int ReadValue (NumberTracker &_numTracker)
{
	auto int input = 0;

	// Read result of scan //
	auto int result = scanf ("%i", &input);

	// Verify if data was read properly //
	if (result)
		{
			// Check if EOF; if EOF return EOF //
			if (input == EOF)
				{
				return EOF;
				}
			// Input not EOF; assign input to currentValue //
			else
				{
					_numTracker.currentValue = input;
				}
		}

	return result;
}

// ==== CompareValue ==========================================================
//
// Compares the current integer value entered by the user to the min and max
// integer values.
//
// Input:
//      _numTracker    -- reference to a NumberTracker struct.
//
// Output:
//      No output.
//
// ============================================================================
void CompareValue (NumberTracker &_numTracker)
{
	// Make sure this isn't the first run through //
	if (_numTracker.minValue && _numTracker.maxValue)
		{
		// Check to see if currentValue is below current min //
		if (*_numTracker.minValue > _numTracker.currentValue)
			{
			*_numTracker.minValue = _numTracker.currentValue;
			}
		else
			{
			// Check to see if currentValue is above current max //
			if (*_numTracker.maxValue < _numTracker.currentValue)
				{
				*_numTracker.maxValue = _numTracker.currentValue;
				}
			}
		}
	// There current existing min or max values; instantiate min/max integers
	// and assign the currentValue to both of them.
	else
		{
		_numTracker.minValue = new int;
		_numTracker.maxValue = new int;

		*_numTracker.minValue = _numTracker.currentValue;
		*_numTracker.maxValue = _numTracker.currentValue;
		}
}
///////////////////////////////////////////////////////////////////////////////