ooh, I can play "post the same reply twice, too" :p
on how to pass arrays into function:
http://www.cplusplus.com/doc/tutorial/arrays/
if you only want to pass a single element of the array, just do it the way you do normal variables
q: are there typos in you code? or copy and paste?
e.g
1 2 3
|
//normally it's type arrayName[arraySize], where size is declared constant
const int SIZE = 0;
double elements[100];
|
- or lines 26-37: a loop without braces will only affect the first line after loop declaration
- there are also missing braces in
readFile(double, const int)
, and 'array_len' and 'array' are not defined -probably you meant element[] and size?
- there are also undefined variables in sortArray() and search()
- is screenOutput() supposed to return an int?
just follow the link at the top of this post, and from there find the tutorial on functions too
p/s sorry I messed up the link earlier >:D