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