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

John (Eljay) Love-Jensen eljay@adobe.com
Thu Oct 29 14:54:00 GMT 2009


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



More information about the Gcc-help mailing list