Back for more help, that I am. So now we are working with arrays (oooooooo, aaaahhh), and I have to send multiple arrays from main() to another function. When I compile, it gives me this error:
In function 'int main()': cannot convert 'double
x' to 'double' for argument '1' to 'void buildArrays(double, double, double)'
These are the lines that pertain to this problem:
double gas[NUM_MON], elec[NUM_MON], water[NUM_MON];
buildArrays(gas, elec, water);
void buildArrays(double gas[], double electricity[], double water[])
{
}
NUM_MON is a constant int with the value 12.
For those of you that don't understand C++:
The call statement for buildArrays does not have to have the same variables as the function. It knows the numbers/arrays by position (gas = gas[], elec = electricity[], water = water[]).
Numbering each position in an array always starts with 0. That means since there are 12 positions in the array, numbering goes from 0 to 11 (which also means that the error is referring to the 2nd position, numbered "1").
According to my professor's lecture notes, I am doing this correctly. Any ideas what is wrong?
As stated with my earlier problem, I use a different C++ program than my professor. This may contribute to the problem, but I doubt it.
Any help would be greatly appreciated. Java is very similar to C++, so those that know Java can also cotribute their
.
Thanks in advance!