1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// vector::front
#include <iostream>
#include <vector>
int main ()
{
std::vector<int> myvector;
myvector.push_back(78);
myvector.push_back(16);
// now front equals 78, and back 16
myvector.front() -= myvector.back();
std::cout << "myvector.front() is now " << myvector.front() << '\n';
return 0;
}
| |