c++ - possible lexical error
- "Wang Phi Phi" <wphiphi brutele.be> Aug 04 2001
- "Walter" <walter digitalmars.com> Aug 04 2001
- "Wang Phi Phi" <wphiphi brutele.be> Aug 05 2001
- Jan Knepper <jan smartsoft.cc> Aug 04 2001
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) :
<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
Aug 04 2001









"Wang Phi Phi" <wphiphi brutele.be> 