www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.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

↑ ↓ ← "Wang Phi Phi" <wphiphi brutele.be> writes:
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
"Walter" <walter digitalmars.com> writes:
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
↑ ↓ → "Wang Phi Phi" <wphiphi brutele.be> writes:
Thanks .
Aug 05 2001
→ Jan Knepper <jan smartsoft.cc> writes:
 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