None of $ or @ is part of the standard C character set (C11 5.2.1 Character set , clause 3):
Both basic character sets of the initial and main versions should have the following elements: 26 capital letters of the Latin alphabet
ABCDEFGHIJKLM NOPQRSTUVWXYZ
26 lowercase latin letters
ABCDEFGHIJKLM NOPQRSTUVWXYZ
10 decimal digits
0 1 2 3 4 5 6 7 8 9
next 29 graphic characters
! " # % & ' ( ) * + , - . / : ; < = > ? [ \ ] ^ _ { | } ~
a space character and control characters representing the horizontal tab, vertical tab, and shape.
The C ++ standard says the same thing ( 2.2 character sets , clause 1):
The main source character set consists of 96 characters: a space character, control characters representing the horizontal tab, vertical tab, form feed and new line, as well as the following 91 graphic characters:
abcdefghijklmnopqrstu vwxyz ABCDEFGHIJKLMNOPQRSTU VWXYZ 0 1 2 3 4 5 6 7 8 9 _ { } [ ]
So, if you can or cannot use them (in general or even for a specific purpose), it depends on your implementation.
In your case, it looks like you are probably using GCC, which allows $ in identifiers as an extension, but does not allow @ - perhaps because GCC also compiles Objective-C code, where @ has special meaning.
From the GCC Documentation :
In GNU C, you can usually use dollar signs in identifier names. This is because many traditional C implementations allow such identifiers. However, dollar signs in identifiers are not supported on several target computers, usually because the target assembler does not allow them.