title: how to get the middle value in real-time/c++
body: <p>If I get some values from the keyboard, how can I find the middle value between them in real time? </p>
  
  <p>this is what I have done but without any result :(</p>
  
  <pre><code>float *p=new float;  //p points to the first element
  float *my;
  std::cin &gt;&gt; my;
  vector&lt;float*&gt;V;
  V.push_back(my);
  std::vector&lt;float*&gt;::iterator it;
  p=my;
  
   while(my){
     it=V.begin()+1;
   }
  
  int M =(*it-p)/2;
  
  delete[] p;
  </code></pre>
  
  <p>to clarify: The middle in terms of order they were given</p>