help with c translation

Ary Borenszweig ary at esperanto.org.ar
Thu Jul 2 04:42:01 PDT 2009


Lars T. Kyllingstad escribió:
> robby wrote:
>> i'm using D1/Tango. sorry, im not sure to how to explain the error 
>> messages, but if you need to look a t full code, here is the link
>> http://www.ibsensoftware.com/download.html
>>
>> thanks again.
> 
> 
> Several places in that code, I notice things like this:
> 
>     const type foo;
>     ...
>     foo = bar;
> 
> I have no idea why this works in C, but in D it certainly doesn't.

Well, it should work! const means, once a value is assigned to that 
variable, it never changes again. The compiler can do static analysis to 
verify this. And that's why it works. And that's why D should also work 
this way, IMHO.


More information about the Digitalmars-d-learn mailing list