digitalmars.D.learn - strings and array literal mutability
- Freddy (1/1) Feb 24 2015 Why are strings immutable but array literals are not?
- Tobias Pankrath (2/3) Feb 24 2015 Because string is an alias for immutable(char).
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (3/6) Feb 24 2015 You meant immutable(char)[]. :)
Why are strings immutable but array literals are not?
Feb 24 2015
On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:Why are strings immutable but array literals are not?Because string is an alias for immutable(char).
Feb 24 2015
On 02/24/2015 02:51 PM, Tobias Pankrath wrote:On Tuesday, 24 February 2015 at 22:12:57 UTC, Freddy wrote:You meant immutable(char)[]. :) AliWhy are strings immutable but array literals are not?Because string is an alias for immutable(char).
Feb 24 2015