I am unable to get the following code working properly.
#include <iostream>
using namespace std;
void neuron(double inputs[])
{
for (int i = 0; i < sizeof(inputs); i++) {
cout<<inputs[i];
}
}
int main()
{
double inputs[] = {10,12,12};
neuron(inputs);
return 0;
}
I want to pass an array to the function neuron
and then print the elements. I am unable to do that. The code is giving me garbage values. What is wrong with this code?