title: I can enter the inputs but I'm not able to see the output when I run my code (CTRL+F5) in C++ in visual studio 2017
body: <blockquote>
    <p>I can enter the inputs but I'm not able to see the output when I run my code (CTRL+F5) in C++ in visual studio 2017. This code is written to overload the operator *, ">>" &amp; "&lt;&lt;" through the friend functions. one constructor initializes the vector elements to zero while the other constructor is used to initialize the elements of vector through the array.</p>
  </blockquote>
  
  <h2>My code is as below:</h2>
  
  <pre><code> //vector.h
  
  #pragma once
  const int SIZE = 3;
  #include&lt;iostream&gt;
  using namespace std;
  class vector
  {
      int v[SIZE];
  public:
      vector();
      vector(int *x);
      friend vector operator *(vector a, int b);
      friend vector operator *(int b,vector a);
      friend istream &amp; operator &gt;&gt;(istream &amp;input, vector &amp;x);
      friend ostream &amp; operator &lt;&lt;(ostream &amp;output, vector &amp;y);
  
  };
  
      //vector.cpp
  
  #include "vector.h"
  #include&lt;iostream&gt;
  using namespace std;
  
  
  
  vector::vector()
  {
      for (int i = 0; i &lt; SIZE; i++)
          v[i] = 0;
  
  }
  vector::vector(int *x)
  {
      for (int i = 0; i &lt; SIZE; i++)
          v[i] = x[i];
  
  }
  vector operator *(vector a, int b) {
      vector temp;
      for (int i = 0; i &lt; SIZE; i++)
          temp.v[i] = a.v[i]*b;
      return temp;
  
  
  }
  vector operator *(int a, vector b) {
      vector temp;
      for (int i = 0; i &lt; SIZE; i++)
          temp.v[i] = a * b.v[i];
      return temp;
  }
  istream &amp; operator &gt;&gt;(istream &amp;input, vector &amp;x) {
      for (int i = 0; i &lt; SIZE; i++)
          input &gt;&gt; x.v[i];
      return (input);
  
  
  }
  ostream &amp; operator &lt;&lt;(ostream &amp;output, vector &amp;y) {
      output &lt;&lt; "(" &lt;&lt; y.v[0];
      for (int i = 1; i &lt; SIZE; i++)
          output &lt;&lt;","&lt;&lt; y.v[i];
      output &lt;&lt; ")";
      return (output);
  
  }
  
      //main.cpp
  
  #include "vector.h"
  #include&lt;iostream&gt;
  using namespace std;
  int x[SIZE] = { 2,4,6 };
  int main() {
  
      vector m;   
      vector v2 = x;
      cout &lt;&lt; "Enter the elements of vector m:" &lt;&lt; "\n";
      cin &gt;&gt; m;
      cout &lt;&lt; "\n";
      vector m1, m2;
      m1 = m * 2;
      m2 = 2 * v2;
      cout &lt;&lt; "m= "&lt;&lt;m&lt;&lt;"\n"; 
      cout &lt;&lt; "\n";
      cout &lt;&lt; "m1= " &lt;&lt; m1 &lt;&lt; "\n";
      cout &lt;&lt; "m2= " &lt;&lt; m2 &lt;&lt; "\n";
      cin.get();
  
      return 0;
  
  
  }
  </code></pre>