| Thread overview | |||||
|---|---|---|---|---|---|
|
February 06, 2008 Error on website. | ||||
|---|---|---|---|---|
| ||||
char[] str; char[] str1 = "abc"; str[0] = 'b'; // error, "abc" is read only, may crash Editing str has nothing to do with str1, as far as I know. | ||||
February 07, 2008 Re: Error on website. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Saaa | On Wed, 06 Feb 2008 21:23:06 +0100, Saaa wrote:
> char[] str;
> char[] str1 = "abc";
> str[0] = 'b'; // error, "abc" is read only, may crash
>
> Editing str has nothing to do with str1, as far as I know.
True, but it fails because str points to nothing.
| |||
February 07, 2008 Re: Error on website. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips |
>> char[] str;
>> char[] str1 = "abc";
>> str[0] = 'b'; // error, "abc" is read only, may crash
>>
>> Editing str has nothing to do with str1, as far as I know.
>
> True, but it fails because str points to nothing.
Or, in other words: isn't long enough :)
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply