a string constant
Just as you have started it. good examples: 'string' "string" `string` »string« bad examples: 'string" "string` »string'
string-literal
In C, you can assign integers multiple characters such that they fit in their size. For e.g.: int - 4 bytes char - 1 byte So an assignment like this is valid: int a = 'ABCD'; The first byte in a will be assigned the value of 'A', the second - 'B' and so on. A string literal is a character array constant. It is enclosed in double quotes and assignment can only be made to a char pointer. There is no limit on the size of the literal and it is terminated with a null character. e.g.: char str[] = "This is a trial";
example: SELECT name, '*', address FROM table; Here '*' is a literal character.
a string constant
Well, A is an identifier; 'A' is a character-literal; "A" is a string literal (of 1 character); "'A'" is another string literal (of 3 characters).
a -- identifier 'a' -- character-literal "a" -- string-literal
'b' is a character literal. A character literal is a character enveloped in single quotes, just as a String literal is a String enveloped in double quotes (without the use of a constructor.)
Just as you have started it. good examples: 'string' "string" `string` »string« bad examples: 'string" "string` »string'
An identifier is a sequence of characters used to denote one of the following:Object or variable nameClass, structure, or union nameEnumerated type nameMember of a class, structure, union, or enumerationFunction or class-member functiontypedef nameLabel nameMacro nameLiterals (C++)Invariant program elements are called "literals" or "constants." The terms "literal" and "constant" are used interchangeably here. Literals fall into four major categories: integer, character, floating-point, and string literals.A literal may be any of the following:integer-constant character-constant floating-constant string-literal
Character array (string literal).
string-literal
string-literal
int a; -- variable definition"int a" -- string literal
a named constant is pretty much the same thing as a literal constant, except it is a name. both cannot change. literal constants are numbers, named constants are words. tada!
A literal can be a number, a character, or a string. For example, in the expression, x = 3 x is a variable, and 3 is a literal.