Hi,
I'm trying to write a code, where numbers in an array, are multiplied by another array of numbers.
In addition, once the multiplied array has reached its final number it has to loop again. Then continue multiplication till the array of of numbers have been multiplied.
Here's an example of what I mean:
5,5,7 -used for multiplication
1,2,1,2,2,1,1 -array of numbers
1x5, 2x5, 4x7,
2x5, 2x5, 1x7,
1x5
Here's my code: -it doesn't compile, but I'm trying to find a way to fix it
Code:
int main()
{
int sample[] = {1,2,4,5,7,9,1};
filterSamples(sample);
return 0;
}
int filterSamples(int& samples[])
{
double countNumber = 0;
double filterNumbers[] = {2.5, 3.4, 5};
double *filterResults;
//filterResults = (double *) malloc(samples);
for(int i=0; i<samples.length(); i++)
{
filterResults = samples[i] * filterNumbers;
countNumber++;
}
//finalNumbers = filterSamples;
cout << "filtered: " << countNumber << ". " << filterResults << "\n" << endl;
return 0;
}