Re: SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
On Tuesday, 19 December 2023 at 14:01:31 UTC, John Kiro wrote: Thanks Adam. I agree, the behavior associated with the initialization here is confusing (compared for example to a similarly-looking code in Java). Also I don't get why an array of characters would be considered as an immutable

Re: SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
Thanks Adam. I agree, the behavior associated with the initialization here is confusing (compared for example to a similarly-looking code in Java). Also I don't get why an array of characters would be considered as an immutable array of characters (that is a **string**). I agree this could be

SIGSEGV (Segmentation Fault) upon setting character in char array (object member var)

2023-12-19 Thread John Kiro via Digitalmars-d-learn
Hello there, First time to experiment with DLang, after a long time. I'm getting a weird behavior with an **array of chars**, where I get a segmentation fault upon writing to it (see code and output below). What makes this problem weird it two things: 1) Why there is no problem with the