reference vector<X,A>::at(size_type qIndex);
#include <vector>
const_reference vector<X,A>::at(size_type qIndex) const;
#include <iostream>
#include <vector>
int main()
{
using namespace std;
// Create a vector instance
vector<int> qV;
qV.push_back(3);
qV.push_back(4);
int& irIntRef = qV.at(0);
const int& kirConstIntRef = qV.at(1);
cout << "V[0] = " << irIntRef << endl;
cout << "V[1] = " << kirConstIntRef << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.