Page 1 :
+1 Computer Application/Science, , Getting Started With C++, (Introduction to C++ Programming), , Short Note, To watch video class click here
Page 2 :
C++, , ●, , C++ is a powerful object oriented programming language, , ●, , Developed by Bjarne Stroustrup., , ●, , C++ is an added (incremented) version of C language.
Page 4 :
Character set, , ●, , Alphabet of a programming language is called character set., , ●, , പ്രോഗ്രാമിംഗ് ഭാഷയുടെ അക്ഷരമാലയെ character set എന്ന് വിളിക്കുന്നു., , ●, , It is the set of valid characters in C++.It is the fundamental, units of C++, Following are the character set of C++, – Letters, – Digits, – Special characters, – White spaces, – Other characters
Page 9 :
Identifiers, ●, , Identifiers are user defined names., , ●, , They are used for naming variables,functions,labels.., Rules for identifiers, 1. It contains only letters,digits and underscore(_), 2. Keywords cant be used as identifiers, 3. Special characters and white spaces are not allowed, 4. Upper case and lower case are different, 5. First character must be letter or under score(_)
Page 11 :
Identify invalid identifiers from the list given below, and justify your answer, a_123,a+b, first number,_123, INT,int,cin, , Ans) a+b(Special characters are not allowed), first number( White spaces are not allowed), int (Key words are not allowed), , cin and INT are identifiers
Page 12 :
Literals, ●, , Data items that never change their value is called literals, , ●, , They are also called constants, There are four types of literals, 1. Integer literals, 2. Floating point literals, 3. Character literals, 4. String literals
Page 13 :
Integer literals, The numbers without fractional part are called integer literals., Examples: 123,-234,+100,15000, , Floating point Literals, The numbers with fractional part are called floating point literals., Also called real constants, Examples: 2.5, -56.986, 453.E-5, 1520E04, They can be written in one of the two forms, –, , Fractional form, , Example 5.8,, , 0.235, , –, , Exponential form. Example 0.58E1,, , A real constant in exponential form consists of two parts: mantissa and exponent., Example: 5.8 can be written as 0.58×10 1 = 0.58E1 where mantissa part is 0.58 and exponential part is 1, 25.67 can be written as 0.2567E2
Page 14 :
Character Literal, A single character enclosed in single quotes, Examples: ‘a’, ‘2’,, , ‘+’,, , ‘\t’, ‘\n’, , String Literals, One or more characters enclosed in double quotes is called string., Examples: “Fathima”,, , “ABC”,, , “a”,, , “123”, , The character constants ‘\t’ and ‘\n’ are escape sequences., Escape sequence is a character constant, to represent non graphic symbols
Page 15 :
Operators, Is a symbol to represent an operation., Example: In a+b, , ,, , + is an operator, , In the statement s=n1+n2;, , = and + are operators, , Punctuators, Some special symbols that have syntactic or semantic meaning to the compiler., These are called punctuators., Examples are: # ; ‘ “ (, ) [ ], {, }
Page 16 :
In short, , Tokens are, Keywords, Reserved words, , Identifiers, User defined names, , Literals(Constants), Tokens that do not change their value, , Punctuators, Used for the perfection of syntax/Separating tokens, , Operators, Symbols for representing an operation
Page 17 :
Identify the following C++ tokens., (a) "welcome" (b) int (c) >= (d) ++, Ans) a- String Literal b- keyword c- operarots d)Operators, , Identify different tokens from the following C++ statement., , sum=num1+num2+10;, Ans)sum,num1,num2 ----> identifier, =,+ ----------> operators, 10 -------------> Literal, ;, -------------> punctuator
Page 18 :
Integrated Development Environment (IDE), ●, , ●, , ●, , The work area for typing,editing ,compiling and executing C++, program is called C++ IDE., We use GCC with Geany IDE ., GCC is a free software available with Linux operating system., GCC stands for GNU Compiler Collection, , ●, , GCC versions are available for Windows platforms also., , ●, , C++ programs are saved with file extension .cpp
Page 19 :
To watch video class click here