Commit 693b4cd2 authored by Rachel Wil Sha Singh's avatar Rachel Wil Sha Singh 💬
Browse files

STL Vector example code

parent a59c266c
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileVersion major="1" minor="6" />
<Option title="STL vector" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Target title="Debug">
<Option output="bin/Debug/STL vector" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Add option="-g" />
<Target title="Release">
<Option output="bin/Release/STL vector" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Add option="-O2" />
<Add option="-s" />
<Add option="-Wall" />
<code_completion />
<debugger />
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
// Vector
vector<string> nameList;
// Add to vector
nameList.push_back( "Bob1" );
nameList.push_back( "Bob2" );
nameList.push_back( "Bob3" );
nameList.push_back( "Bob4" );
// Access element
cout << nameList[0] << endl;
cout << nameList.size() << endl;
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment