Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 0.23 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Real world use-case for the `at()` indexing function in the C   std library?
  2. std::vector<std::vector<int> >::iterator i;
  3. for (i = v2.begin(); i != v2.end(); ++i)
  4. {
  5.     int x1 = (*i)[3]; // UGLY
  6.     int x2 = i->at(3); // Looks OK
  7. }