while doing programming in any programming language, you need some specific words to tell the compiler. Here I will explain these words.
TOKENS:-it is the smallest unit in a program, these are of five types.
DATA TYPES MODIFIERS:-Expect type void, the basic data types can be modified by using modifiers such as
TOKENS:-it is the smallest unit in a program, these are of five types.
- Keywords:-These are the words that convey a special meaning to the language compiler like default, case, break etc.
- Identifiers:-It is the name given by the user for a unit of the program.Identifiers can contain letters and digits.example are MYFILE,_DS,z2t0z9.
- Literals:-These are data items that never change their value during a program run (often referred to as constants).examples integer-constant,character-constant,floating-constant,string-literal.
- Punctuators:-It enhance a program's readability and give proper meaning to statements, expressions etc as per syntax. examples are {},[ ].
- Operators:-These are tokens that trigger some computation or action when applied to the variable and other objects in an expression.examples are arithmetic operators, logical operators, relational operators, conditional operators.i will explain it further.
- Fundamental data types: These are those that are not composed of other data types.These are six fundamental data types in C++.
- Int Data type: Int stores integer i.e. 34,-678 etc.They have no fractional parts.
- Char Data type: Char stores character.character can store character variable.examples are &,b,% and 3.
- Float Data type: Float stores floating-point numbers.it stores number having integer plus fractional part.example are 8.98888,7.89.
- Double Data type: Double stores twice as int and float.
- Void Data type: The void type specifies an empty set of values.It is used as the return type for functions that do not return a value.
- Bool Data type: Bool stores Boolean algebra.It stores either true or false.
DATA TYPES MODIFIERS:-Expect type void, the basic data types can be modified by using modifiers such as
- signed
- unsigned
- long
- short
- Array: Arrays refer to a named list of a finite number n of similar data elements.Examples are ary[1],ary[2].......ary[n].
- Function: A function is a named part of a program that can invoke from other parts of the program as often needed.
- Pointer: A pointer is a variable that holds a memory address(type *ptr).
- Reference: A reference is an alternative name of an object.The general declaring of reference variable is :type &ref-var=var-name;
- Constant: The keyword const can be added to the declaration of an object to make that object a constant rather than a variable.The general declaration of constant is -const type name=value;
- User-Defined Derived Data Types:-There are some derived data types that are defined by the user.
- Class:- A class represent a group of similar objects.
- Structure: A structure is a collection of variables referenced under one name, providing convenient means of keeping related information together.
- Union: A union is a memory location that is shared by two or more different variables, generally of different types at different times.
- Enumeration:- An alternative method for naming integer constants is often more convenient than const.
0 comments:
Post a Comment