version and extern problems

0ffh spam at frankhirsch.net
Wed Jul 11 01:46:40 PDT 2007


nonnymouse wrote:
> Surely that's just an "x is not defined on line 2" error?

Nope. This, for example, is a perfectly valid D programme:

---<snip>---
module test;

int y=3+x;
const int x=5;

void main()
{
   printf("x=%i y=%i\n",x,y);
}
---<snap>---

Seems like D collects all declarations first, unlike C.

Regards, Frank



More information about the Digitalmars-d mailing list