Skip to content

Commit cc08b54

Browse files
authored
Merge pull request MicrosoftDocs#3275 from TylerMSFT/twhitney-fixcode
fix const and tidy up
2 parents 6fe3169 + 956d7d5 commit cc08b54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/standard-library/codecvt-class.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,11 @@ using namespace std;
479479
int main( )
480480
{
481481
locale loc ( "German_Germany" );
482-
int result1 = use_facet<codecvt<char, char, mbstate_t> > ( loc ).encoding ( );
482+
int result1 = use_facet<codecvt<char, char, mbstate_t>> ( loc ).encoding ( );
483483
cout << result1 << '\n';
484-
result1 = use_facet<codecvt<wchar_t, char, mbstate_t> > ( loc ).encoding( );
484+
result1 = use_facet<codecvt<wchar_t, char, mbstate_t>> ( loc ).encoding( );
485485
cout << result1 << '\n';
486-
result1 = use_facet<codecvt<char, wchar_t, mbstate_t> > ( loc ).encoding( );
486+
result1 = use_facet<codecvt<char, wchar_t, mbstate_t>> ( loc ).encoding( );
487487
cout << result1 << '\n';
488488
}
489489
```
@@ -581,7 +581,7 @@ int main( )
581581
wchar_t* pwszNext;
582582
mbstate_t state = {0}; // zero-initialization represents the initial conversion state for mbstate_t
583583
locale loc("C");//English_Britain");//German_Germany
584-
int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
584+
int res = use_facet<codecvt<wchar_t, char, mbstate_t>>
585585
( loc ).in( state,
586586
pszExt, &pszExt[strlen(pszExt)], pszNext,
587587
pwszInt, &pwszInt[strlen(pszExt)], pwszNext );
@@ -657,10 +657,10 @@ using namespace std;
657657
#define LEN 90
658658
int main( )
659659
{
660-
char* pszExt = "This is the string whose length is to be measured!";
660+
const char* pszExt = "This is the string whose length is to be measured!";
661661
mbstate_t state = {0}; // zero-initialization represents the initial conversion state for mbstate_t
662-
locale loc("C");//English_Britain");//German_Germany
663-
int res = use_facet<codecvt<wchar_t, char, mbstate_t> >
662+
locale loc("C"); // English_Britain"); //German_Germany
663+
int res = use_facet<codecvt<wchar_t, char, mbstate_t>>
664664
( loc ).length( state,
665665
pszExt, &pszExt[strlen(pszExt)], LEN );
666666
cout << "The length of the string is: ";
@@ -703,7 +703,7 @@ using namespace std;
703703
int main( )
704704
{
705705
locale loc( "C");//English_Britain" );//German_Germany
706-
int res = use_facet<codecvt<char, char, mbstate_t> >
706+
int res = use_facet<codecvt<char, char, mbstate_t>>
707707
( loc ).max_length( );
708708
wcout << res << '\n';
709709
}

0 commit comments

Comments
 (0)