Advertisement
obernardovieira

Multiple Values as one parameters

Aug 8th, 2014
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. void printall(std::vector<int> values) {
  5.     for(int n=0; n!= values.size(); n++) {
  6.         std::cout << values.at(n) << std::endl;
  7.     }
  8.     return;
  9. }
  10.  
  11. int main() {
  12.     printall( {5, 10, 14, 16, 17} );
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement