Skip to content

Commit c9701fc

Browse files
author
Colin Robertson
authored
Update algorithm-functions.md
Add header, convert tabs to spaces, edit text.
1 parent a9ef691 commit c9701fc

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

docs/standard-library/algorithm-functions.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -662,29 +662,29 @@ The template function evaluates `*(dest + N) = *(first + N))` once for each `N`
662662

663663
```cpp
664664
// alg_copy_n.cpp
665-
// compile with: /EHsc
666-
665+
// compile with: cl /EHsc /W4 alg_copy_n.cpp
667666
#include <algorithm>
668667
#include <iostream>
668+
#include <string>
669669

670670
int main()
671671
{
672-
using namespace std;
673-
string s1{"bumblebee"};
674-
string s2{ "copper" };
672+
using namespace std;
673+
string s1{"dandelion"};
674+
string s2{"badger"};
675675

676-
cout << s1 << " + " << s2 << " = ";
677-
678-
// Copy the first 3 letters from s1
679-
// to the first 3 position in s2
680-
copy_n(s1.begin(), 3, s2.begin());
676+
cout << s1 << " + " << s2 << " = ";
677+
678+
// Copy the first 3 letters from s1
679+
// to the first 3 positions in s2
680+
copy_n(s1.begin(), 3, s2.begin());
681681

682-
cout << s2 << endl;
682+
cout << s2 << endl;
683683
}
684684
```
685685

686686
```Output
687-
bumblebee + copper = bumper
687+
dandelion + badger = danger
688688
```
689689

690690
## <a name="count"></a> count

0 commit comments

Comments
 (0)