Why does assign of string literal to fixed char array fail?

bearophile bearophileHUGS at lycos.com
Tue May 24 15:26:59 PDT 2011


rthiebaud:

> fails on Windows with:
> 
> First-chance exception at 0x7c812afb in ConsoleApp1.exe: 0xE0440001: 0xe0440001.
> 
> What is wrong?

To me it gives:
object.Exception at src\rt\arraycat.d(31): lengths don't match for array copy

When you assign to a fixed-sized array the source and destination lengths must match (this is not true for global variables. In Bugzilla I have asked to remove this special case, despite some people say this is not a special case).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list