string literal


Also found in: Dictionary, Thesaurus, Medical, Legal, Wikipedia.

string literal

A contiguous set of alphanumeric characters declared in the source code of a program. String literals, which are typically descriptive titles and messages, are output to the screen or printer as written. Depending on the programming language, escape codes for line breaks and such may be inserted within the string and executed as commands. Contrast with numeric literal. See string and escape code.

In the following C example, which uses the backslash as an escape character, "Hello World" is displayed on two lines followed by one blank line:

    printf ("Hello\nWorld\n\n");

            Hello            World
References in periodicals archive ?
TANGLE's lexical analyzer recognizes a fixed set of tokens representing identifiers, string literals, and numeric literals.
To reduce RAM requirements, the compiler places all string literals, constants, and initialized variables that are declared as const (in the C program) in a distinct section that later can be ROMed.