stl is missing from the tutorial?

Hey
I love this website. The explanations here are terrific.
But I miss something.
I have to learn about stl. I need to use lists and vectors in my homework, and I have no idea on where to find enough info about if here. Under "Reference" there's no much explained, it's like I'm expected to know the syntax on my own.
Is it included in the tutorial, and I just missed it? Where please?
Thanks!
http://www.cplusplus.com/reference/vector/vector/

if you click the blue links it should open pages similar to the link below.
each function has a seperate example like the link below.

http://www.cplusplus.com/reference/vector/vector/begin/

here is a simple example.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main()
{
	// you can choose any type you wish to use for example 
    vector<int> numbers;

	// insert items at the end
	numbers.push_back(1);
	numbers.push_back(2);
	numbers.push_back(3);

	// display contents
	for (auto i: numbers)
	{
	   cout << i << endl;
	}

	// clear vector
	numbers.clear();	
	cout << "size of vector" << numbers.size() << endl;
	   
   // insert items at the end
   vector<string> names;
   names.push_back("joe");
   names.push_back("jack");
   names.push_back("john");

   for (auto i: names)
	{
	   cout << i << endl;
	}

   int x;
   cin >> x;
   return 0;
}
Last edited on
> Is it included in the tutorial, and I just missed it?

It is not included in this site's tutorial.

Here are a few tutorials that you can peruse:

Read this brief introductory tutorial first: http://www.mochima.com/tutorials/STL.html
Standard library user guide: https://stdcxx.apache.org/doc/stdlibug/noframes.html
Chapters 12, 18 and 19 of 'The C++ Annotations': http://cppannotations.sourceforge.net/annotations/html/
Thank you :)
Rafael11, I really appreciate the fact that you wrote a code for me.
JLBorges, thank you for the answer, and for your time.
You helped me a lot, thanks!
Topic archived. No new replies allowed.