File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Standard Template Library Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 131131 <ClInclude Include =" resource.h" />
132132 </ItemGroup >
133133 <ItemGroup >
134- <ClCompile Include =" Files\Structs-and-Padding.cpp" />
135134 <ClCompile Include =" Standard Template Library\Vectors.cpp" />
136135 </ItemGroup >
137136 <Import Project =" $(VCTargetsPath)\Microsoft.Cpp.targets" />
Original file line number Diff line number Diff line change 2020 </ClInclude >
2121 </ItemGroup >
2222 <ItemGroup >
23- <ClCompile Include =" Files\Structs-and-Padding.cpp" >
24- <Filter >Source Files</Filter >
25- </ClCompile >
2623 <ClCompile Include =" Standard Template Library\Vectors.cpp" >
2724 <Filter >Source Files</Filter >
2825 </ClCompile >
Original file line number Diff line number Diff line change 22// Vectors
33
44#include < iostream>
5+ #include < vector>
56using namespace std ;
67
78int main () {
9+
10+ vector<string> strings;
11+
12+ strings.push_back (" one" );
13+ strings.push_back (" two" );
14+ strings.push_back (" three" );
15+
16+
17+ // /ways of accessing elements in vector
18+
819
20+ /* for (int i = 0; i < strings.size(); i++) {
21+
22+ cout << strings[i] << endl;
23+ }*/
24+
25+ // vector<string>::iterator it = strings.begin();
926
27+ /* for (vector<string>::iterator it = strings.begin(); it != strings.end(); it++) {
28+ cout << *it << endl;
29+ }*/
30+
31+
1032 return 0 ;
1133}
You can’t perform that action at this time.
0 commit comments