We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5297a8 commit 37f1695Copy full SHA for 37f1695
doc/manual.rst
@@ -1280,6 +1280,20 @@ string from a cstring:
1280
var cstr: cstring = str
1281
var newstr: string = $cstr
1282
1283
+``cstring`` literals shouldn't be modified.
1284
+
1285
+.. code-block:: nim
1286
+ var x = cstring"literals"
1287
+ x[1] = 'A' # This is wrong!!!
1288
1289
+If the ``cstring`` originates from a regular memory (not read-only memory),
1290
+it can be modified:
1291
1292
1293
+ var x = "123456"
1294
+ var s: cstring = x
1295
+ s[0] = 'u' # This is ok
1296
1297
Structured types
1298
----------------
1299
A variable of a structured type can hold multiple values at the same
0 commit comments