This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Question about---error: stray ‘@’ in program


Hi David,

> I've searched on the net, but I can't find an explanation of what is going on with the above. If you know, please tell me.

On the third line, there are these characters:
A1@B,

The @ character is not a legitimate character for use in an identifier in C.

The legitimate characters are:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
_ 0 1 2 3 4 5 6 7 8 9

(Numbers cannot be used for the initial character.)

With GCC's -fdollars-in-identifiers flag, you can also use:
$

But such use is probably discouraged.

There may be extensions to C which would allow Unicode characters for use in identifiers.  If so, it's not an extension I've used.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]