File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -662,29 +662,29 @@ The template function evaluates `*(dest + N) = *(first + N))` once for each `N`
662
662
663
663
```cpp
664
664
// alg_copy_n.cpp
665
- // compile with: /EHsc
666
-
665
+ // compile with: cl /EHsc /W4 alg_copy_n.cpp
667
666
#include <algorithm>
668
667
#include <iostream>
668
+ #include <string>
669
669
670
670
int main()
671
671
{
672
- using namespace std;
673
- string s1{"bumblebee "};
674
- string s2{ "copper" };
672
+ using namespace std;
673
+ string s1{"dandelion "};
674
+ string s2{"badger" };
675
675
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());
681
681
682
- cout << s2 << endl;
682
+ cout << s2 << endl;
683
683
}
684
684
```
685
685
686
686
```Output
687
- bumblebee + copper = bumper
687
+ dandelion + badger = danger
688
688
```
689
689
690
690
## <a name="count"></a> count
You can’t perform that action at this time.
0 commit comments