What does the word ‘literal’ mean when used in context such as literal strings and literal values?
What is the difference between a literal value and a value?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A literal is ‘any notation for representing a value within source code’ (wikipedia)
(Contrast this with identifiers, which refer to a value in memory.)
Examples:
'hey'(a string)false(a boolean)3.14(a real number)[1,2,3](a list of numbers)(x) => x*x(a function)/^1?$|^(11+?)\1+$/(a regexp)Some things that are not literals:
std::cout(an identifier)foo = 0;(a statement)1+2(an expression)