title: How to pass an input from c++ function to the main function
body: <p>i want to take an input from c++ function and return it to the main function
  , i've already tried to do it but the function returns zero , any idea ?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int input( int x);
  int main()
  {
      int number;
      input(number);
      cout&lt;&lt;number;
  
  }
  int input (int x)
  {
      cin&gt;&gt;x;  
      return  x;
  }
  </code></pre>