www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - necessary?

reply Helmut Leitner <helmut.leitner wikiservice.at> writes:
why is it necessary that a local

   char buf[20]="Hello";

compiles ok, but returns a runtime error:

   Error: lengths don't match for array copy

Global and static initializations work as expected.

-- 
Helmut Leitner    leitner hls.via.at
Graz, Austria   www.hls-software.com
Sep 21 2004
parent Berin Loritsch <bloritsch d-haven.org> writes:
Helmut Leitner wrote:
 why is it necessary that a local
 
    char buf[20]="Hello";
 
 compiles ok, but returns a runtime error:
 
    Error: lengths don't match for array copy
 
 Global and static initializations work as expected.
Hmm. Something that fundamental should not be allowed to compile.
Sep 21 2004