Re: Why is the following failing?

2024-01-25 Thread ryuukk_ via Digitalmars-d-learn
On Thursday, 25 January 2024 at 17:50:57 UTC, Johan wrote: On Thursday, 25 January 2024 at 16:07:44 UTC, Stefan Koch wrote: On Thursday, 25 January 2024 at 15:39:08 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect

Re: Why is the following failing?

2024-01-25 Thread Johan via Digitalmars-d-learn
On Thursday, 25 January 2024 at 16:07:44 UTC, Stefan Koch wrote: On Thursday, 25 January 2024 at 15:39:08 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect for the example above.. Raise a bug, I'll fix it. Hmm.

Re: Why is the following failing?

2024-01-25 Thread Erdem via Digitalmars-d-learn
On Thursday, 25 January 2024 at 16:07:44 UTC, Stefan Koch wrote: On Thursday, 25 January 2024 at 15:39:08 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect for the example above.. Raise a bug, I'll fix it. buna

Re: Why is the following failing?

2024-01-25 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 25 January 2024 at 15:39:08 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect for the example above.. Raise a bug, I'll fix it.

Re: Why is the following failing?

2024-01-25 Thread ryuukk_ via Digitalmars-d-learn
```D void main() { char[32] id = 0; id = "hello"; } ``` this works fine, and that is what i expect for the example above..

Re: Why is the following failing?

2024-01-25 Thread ryuukk_ via Digitalmars-d-learn
On Thursday, 25 January 2024 at 15:22:35 UTC, Hipreme wrote: On Thursday, 25 January 2024 at 15:20:01 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; const(char)* str = "hello"; id = str[0 .. 6]; } ``` it should be a simple memcpy, why DMD complain? ``onlineapp.d(6):

Re: Why is the following failing?

2024-01-25 Thread Hipreme via Digitalmars-d-learn
On Thursday, 25 January 2024 at 15:20:01 UTC, ryuukk_ wrote: ```D void main() { char[32] id = 0; const(char)* str = "hello"; id = str[0 .. 6]; } ``` it should be a simple memcpy, why DMD complain? ``onlineapp.d(6): Error: mismatched array lengths 32 and 6 for assignment `id[] =

Why is the following failing?

2024-01-25 Thread ryuukk_ via Digitalmars-d-learn
```D void main() { char[32] id = 0; const(char)* str = "hello"; id = str[0 .. 6]; } ``` it should be a simple memcpy, why DMD complain? ``onlineapp.d(6): Error: mismatched array lengths 32 and 6 for assignment `id[] = str[0..6]``` I'm too tired to notice something obvious?