Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Reserved word
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Word in a programming language that cannot be used as an identifier}} In a [[programming language]], a '''reserved word''' (sometimes known as a '''reserved identifier''') is a word that cannot be used by a [[programmer]] as an [[Identifier (computer languages)|identifier]], such as the name of a variable, function, or [[Label (programming language)|label]] β it is "reserved from use". In brief, an ''identifier'' starts with a letter, which is followed by any sequence of letters and digits (in some languages, the [[underscore]] '_' is treated as a letter). In an [[Imperative programming|imperative programming language]] and in many [[Object-oriented programming|object-oriented programming languages]], apart from assignments and subroutine calls, keywords are often used to identify a particular [[Statement (computer science)|statement]], e.g. '''if''', '''while''', '''do''', '''for''', etc. Many languages treat keywords as reserved words, including [[Ada (programming language)|Ada]], [[C (programming language)|C]], [[C++]], [[COBOL]], [[Java (programming language)|Java]], and [[Pascal (programming language)|Pascal]]. The number of reserved words varies widely from one language to another: C has about 30 while COBOL has about 400. A few languages do not have any reserved words; [[Fortran]] and [[PL/I]] identify keywords by context, while [[Algol 60]] and [[Algol 68]] generally use [[Stropping (syntax)|stropping]] to distinguish keywords from programmer-defined identifiers, e.g. <code>.if</code> or <code>'if</code> or <code>'if'</code> or <code><u>if</u></code>is a keyword distinct from identifier <code>if</code>. Most programming languages have a standard library (or libraries), e.g. mathematical functions sin, cos, etc. The names provided by a library are not reserved, and can be redefined by a programmer if the library functionality is not required.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)