почему в
#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[])
{
vector<int> queue;
vector<int*> pqueue;
int n;
cin >> n;
while (cin.good()) {
queue.push_back(n);
pqueue.push_back(&queue.back());
cin >> n;
}
copy(queue.begin(), queue.end(), ostream_iterator<int>(cout, " "));
cout << endl;
for (vector<int*>::const_iterator it = pqueue.begin(); it < pqueue.end(); ++it)
cout << **it << " ";
cout << endl;
return 0;
}
$ echo 1 2 3 4 q |./lab7
1 2 3 4
146047008 2 3 4