Posts

Showing posts with the label operators

Operators in C++

 Operators in C++ All the C operators are valid in C++ also. C++ introduce some new operators like insertion operator (<<), extraction operator (>>), and scope resolution operator (::) etc. some of thee new operator added to C in C++ are: ::*      pointer-to-member declarator ->*      pointer-to-member operator .*      pointer-to-member operator delete     memory release operator new     memory allocation operator endl     line feed operator setw     field width operator the different types of the operators which are common in C and C++ are as follows: Arithmetic operator (+, -, *, /, %) Logical operator (&&, ||, !) Relational operator (<, <=, >, >=, ==, !=) Assignment operator (=, +=, -=, *=, /=, %=) Conditional operator (expression ? expression : expression) Bitwise operator (&, |, ^, ~, <<, >>) in C++ we can also add our own meaning to the exist...

Tokens In C++

Image
  Tokens in C++ In C++, the smallest individual unit in a program are known as tokens, C++ has the following tokens: Keywords Identifiers Constants Strings Operators A C++ program is made using this tokens, white space (space, tabs, and newline) and the syntax of the language. Almost all the C++ tokens are same as in the C language with the exception of some addition and minor modification. Keywords Keywords are certain reserved words or identifiers, which cannot be used as a variable name, and other user defines program elements. The bellow is the list of C++ Keywords. There are total 63 Keywords in C++ many of the Keywords are common in both C and C++, and some are added to increase the functionality and features. Identifiers Identifiers refers to the names of the variables, functions, array, classes, objects, etc. that a programmer creates, which are the fundamental requirement of any programming language. Each has its own rules for naming these identifiers, the following are th...