What does the C++ standard say about using dollar signs in identifiers, such as Hello$World
? Are they legal?
Dollar signs in identifiersDollar ( $ ) signs are permitted in identifiers.
AFAIK, it is not allowed in C .
dollar sign ('$') is an illegal character. class is a Python keyword with its special syntax. It can't be used a variable name. A name cannot contain a space Otherwise put, the space character (' ') is illegal in a name, just as '$' is.
In GNU C, you may normally 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 a few target machines, typically because the target assembler does not allow them.
A c++ identifier can be composed of any of the following: _ (underscore), the digits 0-9, the letters a-z (both upper and lower case) and cannot start with a number.
There are a number of exceptions as C99 allows extensions to the standard (e.g. visual studio).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With