Character literal

A character literal is the representation of a single character's value within the source code of a computer program. Languages that have a dedicated character data type generally include character literals; these include C, C++, Java, and Visual Basic, but not Python or PHP. Languages without character data types will typically use strings of length 1 to serve the same purpose a character data type would fulfil. This simplifies the implementation and basic usage of a language but also introduces new scope for programming errors.

Character literal

A character literal is the representation of a single character's value within the source code of a computer program. Languages that have a dedicated character data type generally include character literals; these include C, C++, Java, and Visual Basic, but not Python or PHP. Languages without character data types will typically use strings of length 1 to serve the same purpose a character data type would fulfil. This simplifies the implementation and basic usage of a language but also introduces new scope for programming errors.