Skip to content

Instantly share code, notes, and snippets.

@knapply
Last active November 7, 2018 19:25
Show Gist options
  • Save knapply/7c50ca13ba2a0d9097d9833225ac4cd8 to your computer and use it in GitHub Desktop.
Save knapply/7c50ca13ba2a0d9097d9833225ac4cd8 to your computer and use it in GitHub Desktop.
#cpp #length2
#include <iostream> // std::cout, std::endl
#include <vector> // std::vector
using std::cout;
using std::endl;
using std::vector;
int main() {
vector<double> v{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
int result = size(v);
cout << "length: " << result << endl;
return 0;
}
//> length: 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment