Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - 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 . Aug 04 2001
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 . Aug 04 2001
this sample code compile and work fine with DMC8.1C (and not with VC6) : Aug 04 2001
|