string not aliased

Regan Heath regan at netmail.co.nz
Wed Aug 15 09:32:24 PDT 2007


Anders F Björklund wrote:
> Charles Brossollet wrote:
> 
>> 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)
> 
> The example is using D 2.0, while GDC supports D 1.0 at the moment.
> (the language was split into two different versions a while ago...)
> 
> int main(char[][] args)

Technically I guess it's D 1.016 or D 2.0 code.  Am I correct about 
rebuilding phobos (in my reply to the OP) or will that fail utterly?

Regan


More information about the Digitalmars-d-learn mailing list