WHAT IS C++ | Definition from ProLearner00
INTRODUCTION / What is C++
The C++ programming language was
developed at AT&T Bell Laboratories in the early 1980s by Bjarne
Stroustrup. He found 'C lacking for simulations and decided to extend the
language by adding features from his favourite language, Simula 67. Simula 67
was one of the earliest object oriented languages. Bjarne Stroustroup called it
"C with classes" originally. The name C++ (pronounced C plus plus)
was coined by Rick Mascitti where "++" is the C increment operator.
Ever since its birth, C++ evolved to cope with problems encountered by users,
and through discussions at AT&T. However, the maturation of the C++
language is attested to by two recent events: (i) the formation of an ANSI
(American National Standard Institute) C++ Committee and (ii) the publication
of The Annotated C++ Reference Manual by Ellis and Stroustrup.
C++ CHARACTER SET
Character set is a set of valid
characters that a language can recognise. A character represents any letter,
digit, or any other sign.
The C++ has the following character
set:
Letters A-Z, a-z
Digits 0 -9
Special Symbols Space
+ -* /^ \ ( ) [ ] { } = ! = <
> . ‘ “ $ , ; : % ! & ? _(underscore) # <=
>=
@
White
Spaces Blank space,
horizontal tab( ), Carriage return ( ), Newline, form feed
Other Characters C++ can process any of the 256 ASCII
characters as data or as literals.
<> 5.; %! &? (underscore)
# <= >= @ Blank space, Horizontal tab (→), Carriage return (-), Newline,
Form feed. C++ can process any of the 256 ASCII characters as data or as
literals.
What is TOKENS??
Token The smallest individual unit
to a program is known as a Token or a lexical unit.
TOKENS (LEXICAL UNITS)
In a passage of text, individual
words and punctuation marks are called tokens o lexical units or lexical
elements. C++ has the following tokens:
Keywords
Identifiers
Literals
Punctuators
Operators
What is Keyword??
Keyword is a word Having special meaning reserved by programming language.
Keywords are the words that convey a
special meaning to the language compiler. These are reserved for special
purpose and must not be used as normal identifier names.
The original keywords:
C++ (developed by Stroustrup)
contains the following
Continue float new signed try auto
Default for operator sizeof break typedef
Delete friend private static union case
Do goto protected struct unsigned if
Public switch char virtual inline template
Enum void int retur this extern
catch double else register volatile class const
long short throw while
With revisions and additions, recent
completed list of keywords also includes these keywords:
Using, namespace, bal, static, cast,
const, cast, dynamic, cast, true ,false
In addition, identifiers containing
a double underscore (___) are reserved for use by C++ implementations and
standard libraries and should be avoided by users.
What is Identifier??
An identifier is an arbitrarily long
sequence of letters and digits. The first character must be a letter; the
underscore (_) counts as a letter. Upper and lower-case letters are different.
All characters are significant.
Identifiers are fundamental building
blocks of a program and are used as the general terminology for the names given
to different parts of the program viz. variables, objects, classes, functions,
arrays etc. Identifier forming rule of C++ has been specified in the adjacent
box.
Even though original C++ considers
all the characters, (in an identifier) significant yet it is implementation
dependent. It varies from one version to another.
C++ is case sensitive as it treats
upper and lower-case characters differently.
The following are some valid identifiers:
Myfile DATE9
7.77 MYFILE
CHK _DS 721029 FILE13
The following are some invalid identifiers:
DATA-REC contains
special character (other than A-Z, 2 and )
29CLCT Starting with a digit break
reserved keyword contains
special character dot (-) My.file
Literals
Literals (often referred to as constants) are data items
that never change their value during a program run.
C++ allows several kinds of literals:
bool literal
integer-constant
character-constant
floating-constant
Estring-literal
.png)
Comments
Post a Comment