Thread overview | ||||||
---|---|---|---|---|---|---|
|
August 04, 2001 possible lexical error | ||||
---|---|---|---|---|
| ||||
it seems that DMC autorise the use of the dollar sign in variable/function/... name. this sample code compile and work fine with DMC8.1C (and not with VC6) : #include <iostream.h> void test$function(void) { cout << "hello" << endl; } int main() { int test$5a$$ = 10; test$function(); cout << test$5a$$ << endl; return 0; } output : hello 10 Wang Phi Phi . |
August 04, 2001 Re: possible lexical error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Wang Phi Phi | Yes, it does allow $ as an identifier character. It's a feature, not a bug <g>. The idea is to be compatible with the popular use of $ in assembler code identifiers. It is disabled by the -A switch. -Walter Wang Phi Phi wrote in message <9khu9f$5u8$1@digitaldaemon.com>... >it seems that DMC autorise the use of the dollar sign in variable/function/... name. > >this sample code compile and work fine with DMC8.1C (and not with VC6) : > >#include <iostream.h> >void test$function(void) >{ > cout << "hello" << endl; >} > >int main() >{ > int test$5a$$ = 10; > test$function(); > cout << test$5a$$ << endl; > return 0; >} > >output : >hello >10 > > >Wang Phi Phi . > > > |
August 05, 2001 Re: possible lexical error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Wang Phi Phi | > this sample code compile and work fine with DMC8.1C (and not with VC6) :
<g>
There are a lot of example that work FINE with DMC++ and won't even compile
(or give INTERNAL COMPILER ERROR) with VC--.
Just out of precaution... VC-- isn't quite the 'standard' eventhough many
users of it would think it is...
Jan
|
Copyright © 1999-2021 by the D Language Foundation