Facebook Twitter Instagram
Slider Image 1 Slider Image 2 Slider Image 3

Manipulators

We use manipulators to format the output on screen in a specific manner. Manipulators are the operator for formatting. With the help of manipulators programmer can choose how to display output on screen or device. The manipulators that are used with arguments are worked as functions returning objects of undetermined type. These manipulators define their own operator<< or operator>> which perform the requested manipulation. To use any manipulator other than “endl” we must include new header file . they can be used for both input and output.

Default Image

Escape Sequence

To insert a line break, a new-line character shall be inserted at the exact position the line should be broken. In C++, a new-line character can be specified as \n (i.e., a backslash character followed by a lowercase n). this combination called escape sequence. Escape sequences are special characters used in control string to modify the format of an output. These specific characters are translated into another character or a sequence of characters that may be difficult to represent directly.

Default Image

C++ Output Stream

We provide data to the computer for processing, it called input to the computer. After processing computer shows us results that called output. Input can be given through different devices. Keyboard is a standard data input device. In C++ we can give input to our programme during execution of programme this process called input to the programme and statements that are used to take input from user are called input statements. After processing results are shown and saved on disk. Process of showing results called output and statements by with the help we get output called output statements.

Default Image

Comments

All programming languages provide comment statements in different forms. Comments are used to increase readability of our source code. We can add comments in the form of single line or in block form. To add a single line comment we use double forward slash (//) in the beginning of comment line

Default Image

Typecasting

The process of converting one type data into another type is called type casting. This conversion can be done by default with the help of translator programme (in case of C++ it is done by compiler) or by the programmer. The question raised why we need such type of conversion? Some time we require to use our float type variable sunup with integer type variable

Default Image

Increment and decrement operators

Unary operators that are used to add or subtract 1 from a variable called unary operator. It is used to make some ease in programming.

Default Image

Operators

A symbol that tells compiler to perform some arithmetic task is called an operator. C++ have many types of operators. We can categorize operators in two types as follows: Binary operators Unary operators

Default Image

Overflow and Underflow

verflow is a case where operations on 2 numbers exceeds the maximum (or goes below the minimum) value the data type can have. Usually it is assumed that integral types are very large, and user don’t consider that sum of two numbers can be larger than the range. If the size of a data type is n bytes, it can store 28n different values. This is called the data type’s range. If size of an unsigned data type is n bytes, it ranges from 0 to 28n-1.

Default Image

User-Defined Data Types

C++ is a flexible language, it allows user to define their own data types. User can do this with a keyword typedef.

Default Image

Data Types in C++

While writing source code in any language, you need to use several variables to store information. Variables are reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. You may like to store data of different data types like character, wide character, integer, floating point, double floating point, Boolean etc. Based on the data type of a variable, the translator allocates memory and decides what can be stored in the reserved memory.

Default Image