Skip to content

Commit a0b62f1

Browse files
authored
Visual C++ 17.0 has unlimited string literals
1 parent c01a68e commit a0b62f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/cpp/string-and-character-literals-cpp.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,8 @@ const size_t byteSize = (wcslen(str) + 1) * sizeof(wchar_t);
331331

332332
Notice that `strlen()` and `wcslen()` don't include the size of the terminating null character, whose size is equal to the element size of the string type: one byte on a `char*` or `char8_t*` string, two bytes on `wchar_t*` or `char16_t*` strings, and four bytes on `char32_t*` strings.
333333

334-
The maximum length of a string literal is 65,535 bytes. This limit applies to both narrow string literals and wide string literals.
334+
The maximum length of a string literal was 65,535 bytes. This limit applied to both narrow string literals and wide string literals.
335+
This limit was removed in VS 2022 17.0 GA.
335336

336337
### Modifying string literals
337338

0 commit comments

Comments
 (0)