string not aliased

Tomas Lindquist Olsen tomas at famolsen.dk
Wed Aug 15 11:50:44 PDT 2007


Charles Brossollet wrote:

> Hi all,
> 
> I'm a complete newbie to D, and tried the examples on the Wikipedia
> page. the example 2 shows a main function like this:
> 
> int main(string[] args)   // string is a type alias for const(char)[]
> 
> But, I get this error on compile:
> hello.d:3: Error: identifier 'string' is not defined
> hello.d:3: Error: string is used as a type
> hello.d:3: function hello.main parameters must be main() or
> main(char[][] args)
> 
> Is the guy writing the example wrong? Or is it my environment? (gdc
> 0.23, on Mac OSX 10.4)
> 
> Thanks,
> 
the string alias was added in dmd 1.016 (which btw was a horrible idea
imho), and with gdc 0.23 being 1.007 it's not availble, seems like someone
was a bit enthusiastic updating the wikipedia pages.


More information about the Digitalmars-d-learn mailing list