Skip to content

Commit 5dbe71d

Browse files
TylerMSFTTylerMSFT
authored andcommitted
fix github #2749 as well
1 parent caf476c commit 5dbe71d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/atl-mfc-shared/reference/csimplestringt-class.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,19 +1162,19 @@ The following example demonstrates the use of `CSimpleStringT::Truncate`.
11621162
CAtlString basestr;
11631163
IAtlStringMgr* pMgr = basestr.GetManager();
11641164
CSimpleString str(_T("abcdefghi"), pMgr);
1165-
_tprintf_s(_T("Allocated length: %d\n"), str.GetLength());
1166-
_tprintf_s(_T("Contents: %s\n"), str);
1165+
_tprintf_s(_T("String length: %d / Allocated length: %d\n"), str.GetLength(), str.GetAllocLength());
1166+
_tprintf_s(_T("Contents: %s\n"), (LPCTSTR)str);
11671167
str.Truncate(4);
1168-
_tprintf_s(_T("Allocated length: %d\n"), str.GetLength());
1169-
_tprintf_s(_T("Contents: %s\n"), str);
1168+
_tprintf_s(_T("String length: %d / Allocated length: %d\n"), str.GetLength(), , str.GetAllocLength());
1169+
_tprintf_s(_T("Contents: %s\n"), (LPCTSTR)str);
11701170
```
11711171
11721172
The output from this example is:
11731173
11741174
```Output
1175-
Allocated length: 9
1175+
String length: 9 / Allocated length: 15
11761176
Contents: abcdefghi
1177-
Allocated length: 4
1177+
String length: 4 / Allocated length: 15
11781178
Contents: abcd
11791179
```
11801180

0 commit comments

Comments
 (0)