reference vector<X,A>::operator[](size_type qIndex);
#include <vector>
const_reference vector<X,A>::operator[](size_type qIndex) const;
#include <iostream>
#include <vector>
int main()
{
using namespace std;
// Create a vector instance
vector<char> qV;
qV.push_back('X');
qV.push_back('o');
qV.push_back('a');
qV.push_back('X');
qV.push_back('.');
qV.push_back('n');
qV.push_back('e');
qV.push_back('t');
// Use the array operator to access elements
for (int iIndex = 0; iIndex < 8; ++iIndex) {
cout << qV[iIndex];
}
cout << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.