Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4659c4a

Browse files
vector from array of char*
1 parent eab7de4 commit 4659c4a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vector_initialization_with_values.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@ int main() {
1212
std::vector<int> c(10, 1);
1313
std::copy(c.begin(), c.end(), std::ostream_iterator<int>(std::cout, " "));
1414
std::cout << std::endl;
15+
//1 1 1 1 1 1 1 1 1 1
16+
17+
std::vector<std::string> vs({ "xyzzy", "plugh", "abracadabra" });
18+
std::copy(vs.begin(), vs.end(), std::ostream_iterator<std::string>(std::cout, " "));
19+
std::cout << std::endl;
20+
//xyzzy plugh abracadabra
21+
1522
return 0;
1623
}

0 commit comments

Comments
 (0)