![]() |
| | #1 |
| Registered User Join Date: Feb 2002
Posts: 3
| dollar sign is legal in gcc consider this: #include <iostream.h> int main() { int $one; cout << $one; return 0; } i've tried this code on bcc 5.5 and it does not compile, but on gcc 2.95 (on linux) it compiles perfectly. why? |
| sourcerer is offline | |
| | #2 |
| B26354 Join Date: Jan 2002
Posts: 631
| GG is correct. The '$' character may not be part of an identifier under ANSI C. You can force gcc to adhere strictly to ANSI C by using the -ansi switch in your compiles. What you lose with the -ansi switch are the keywords asm, inline, and typeof (as well as some macros). The gcc man page has all the details.
__________________ Jason Deckard |
| Deckard is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Profiler Valgrind | afflictedd2 | C++ Programming | 4 | 07-18-2008 09:38 AM |
| Compiles on gcc 3.3 but not on gcc 4.0.3 | cunnus88 | C++ Programming | 5 | 03-29-2007 12:24 PM |
| My own itoa() | maxorator | C++ Programming | 18 | 10-15-2006 11:49 AM |
| Can't get output to display dollar sign | carolsue2 | C++ Programming | 5 | 02-28-2006 12:10 PM |
| gcc | DavidP | A Brief History of Cprogramming.com | 21 | 10-22-2003 03:46 PM |