hey srfischer83
the variable intNum is being used as an array index and its not initialized, its always good to initialize all your variables before you use them. Primitive arrays requires constant **integer** expressions as index.
the way you initialized your array is also wrong, use braces.
C++ requires function prototypes or the definition must appear before its used, i can see the prototype inside main thats acceptable but you never used it? why?
AND the prototype says
void getExtremes( float );
while the fuction actually ask for an array
void getExtremes( float num[10])
Plus you're not passing the array length to your function.
use a const variable for the length;
You need to #include "conio.h" for getch();
but if all you want is to stop the program to get that "pause" effect you can use cin.get() from <iostream> you are using it anyway for the input/output operations.
and yeah unless its #included in "stdafx.h" plz
#include <iostream>
You are supposed to display the min and max value inside a ****float*** array but then you ask the user for ****integers****?
|
cout<<"Please enter 10 integers."<<endl;
|
fix some typos and your getExtreme function works.
more info:
http://www.cplusplus.com/doc/tutorial/functions.html
http://www.cplusplus.com/doc/tutorial/arrays.html
Jeff