SlideShare a Scribd company logo
5
Most read
6
Most read
12
Most read
MANIPULATORS
Presented By- Vaishnavi
(B.Sc IT 4th sem)
Email id-vaishnavi2021999@gmail.com
.
.
.
2
Hello!
I am Vaishnai
I am here because I love to give
presentations.
You can find me at @vaishnavi.in
3
CONTENTS
• Introduction to Manipulators
• Types of Manipulators
• Input manipulators
• Output Manipulators
• Parameterized manipulators
4
INTRODUCTION
• Manipulators are operators that are used to format the data display .
• It is mainly used for make-up the program.
• Manipulators functions are special stream function that changes certain
characteristics of the input and output .
• To carry out the operations of the manipulators functions in user program, the
header file input and output manipulator<iomanip.h> must be included.
• Manipulators are the functions specially designed to be used in conjunction with
insertion (<<) and extraction (>>) operator on stream object.
e.g.- cout<<boolalpha;
• Manipulators are used to change formatting parameters on streams and to insert
or extract certain special characters.
.
6
• Ws-The manipulator function ws stands for white space. It is used to ignore the
leading white space that precedes the first field.
INPUT MANIPULATORS
.
7
OUTPUT MANIPULATORS
i. Endl- The endl is an an output manipulator to generate a carriage return or
linefeed character. The endl may be used several times in a c++ statement.
Write a newline ('n') and flush buffer.
ii. Ends-The ends is a manipulator used to attach a null terminator(‘0’) at the end
of a string.
The ends manipulator takes no argument whenever it is invoked.
This causes a null character to the output.
.
.
8
Continued…
iii. Flush -The flush member function is used to cause the stream associated with
the output to be completely emptied.
This argument function takes no input parameter whenever it is invoked.
In case of a disk file being copied to another ,it has to flush the output
buffer prior to rewinding the output file for continued use .
Flush() does not have anything to do with flushing the input buffer.
9
PARAMETRIZEDMANIPULATORS
i. Setiosflag- The setiosflag manipulator function is used to control different input
and output settings. The IO stream maintains a collection of flag bits.
The setiosflag manipulators performs the same function as the setf
function.
SYNTAX-setiosflag(long f)
ii. Resetioflags- It performs the same functions as that of the resetf function .
flag represented by the set bits in f are reset.
SYNTAX-Resetioflags(long f)
10
Continued….
• Setw()-The setw() stands for the ‘setwidth’.
The setw() manipulators is used to specify the minimum no. of character
position on the output field a variable will consume.
SYNTAX-setw (int w)
setw(int w) changes the field width to w , but only for the new insertion.
the default width is 0.
Between the data variables in c ++ space will not be inserted automatic
-ally by the compiler .It is upto programmer to introduce proper spaces
among data while displaying onto screen.
11
Continued….
• Setfill()-To Setfill() manipulator function is used to specify a different character to
fill the unused field width of the value.
The default fill character is a space.
SYNTAX-Setfill(char f)
12
Continued….
• Setbase()- Setbase field flag; Sets the base-field to one of its possible values:
decimal, hexadecimal or octal according to argument base.
13
std::Setbase (int base);
decimal : if base is 10
hexadecimal : if base is 16
octal : if base is 8
zero : if base is any other value.
Continued….
• Setprecision-It is used to control the no. of digits of an output stream display of a
floating point value .
SYNTAX-Setprecision(int p)
which set precision for floating point insertion to p.
The default precision is 6.
14
REFRENCES
15
Object Oriented Programming C++
-E.Balagurusamy
Let us C++
-Yashwant Kanetkar
Mastering C++
- K.R.Venugopal
Programming with C++
-C.Ravichandran

More Related Content

PDF
Manipulators
PPTX
LVM "Linux "
PPTX
GCC RTL and Machine Description
PDF
Building Embedded Linux Full Tutorial for ARM
ODP
Apache ppt
PDF
Systemd: the modern Linux init system you will learn to love
ODP
GCC, GNU compiler collection
PDF
Inside Android's UI
Manipulators
LVM "Linux "
GCC RTL and Machine Description
Building Embedded Linux Full Tutorial for ARM
Apache ppt
Systemd: the modern Linux init system you will learn to love
GCC, GNU compiler collection
Inside Android's UI

What's hot (20)

PPT
Introduction to JavaScript
PPT
Unix File System
PDF
Introduction to char device driver
PPT
Java tutorial PPT
PPTX
File in C language
PDF
Ninja Build: Simple Guide for Beginners
PPTX
Introduction to java
PPT
linux device driver
PPT
Lecture 1 programming fundamentals (PF)
PPTX
Vi editor
PPTX
Static Data Members and Member Functions
PPTX
Access specifiers(modifiers) in java
PPT
Shell and its types in LINUX
PPTX
Client side scripting and server side scripting
PPTX
Strings in C
PPTX
VI editor in unix
PDF
Java - File Input Output Concepts
PPTX
Manipulators in c++
PPT
History Of Linux
Introduction to JavaScript
Unix File System
Introduction to char device driver
Java tutorial PPT
File in C language
Ninja Build: Simple Guide for Beginners
Introduction to java
linux device driver
Lecture 1 programming fundamentals (PF)
Vi editor
Static Data Members and Member Functions
Access specifiers(modifiers) in java
Shell and its types in LINUX
Client side scripting and server side scripting
Strings in C
VI editor in unix
Java - File Input Output Concepts
Manipulators in c++
History Of Linux
Ad

Similar to Manipulators (20)

PPTX
9.Manipulators.pptx oops programming in c pp
PDF
Managing I/O in c++
PPTX
Object oriented programming 14 output formatting using manipulators
PPT
Chapter 3 malik
PPT
Chapter 3 malik
PPT
Chapter 3 malik
PPTX
Formatted Console I/O Operations in C++
PDF
Input and Output
PDF
Chap 3 c++
PPT
cpp input & output system basics
PPTX
C++InputOutput.pptx
PPT
Formatted input and output
PDF
Chap 2 c++
PDF
Input and output basic of c++ programming and escape sequences
PPTX
Managing console input
PPTX
Managing console input and output
PPTX
programming fundamental c++ course (1).pptx
PPTX
Managing console of I/o operations & working with files
PPT
keyword
9.Manipulators.pptx oops programming in c pp
Managing I/O in c++
Object oriented programming 14 output formatting using manipulators
Chapter 3 malik
Chapter 3 malik
Chapter 3 malik
Formatted Console I/O Operations in C++
Input and Output
Chap 3 c++
cpp input & output system basics
C++InputOutput.pptx
Formatted input and output
Chap 2 c++
Input and output basic of c++ programming and escape sequences
Managing console input
Managing console input and output
programming fundamental c++ course (1).pptx
Managing console of I/o operations & working with files
keyword
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
Mushroom cultivation and it's methods.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Enhancing emotion recognition model for a student engagement use case through...
NewMind AI Weekly Chronicles - August'25-Week II
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A comparative study of natural language inference in Swahili using monolingua...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Web App vs Mobile App What Should You Build First.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
OMC Textile Division Presentation 2021.pptx
Getting Started with Data Integration: FME Form 101
Mushroom cultivation and it's methods.pdf
Unlocking AI with Model Context Protocol (MCP)
1 - Historical Antecedents, Social Consideration.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cloud_computing_Infrastucture_as_cloud_p
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Enhancing emotion recognition model for a student engagement use case through...

Manipulators

  • 1. MANIPULATORS Presented By- Vaishnavi (B.Sc IT 4th sem) Email id-vaishnavi2021999@gmail.com
  • 3. Hello! I am Vaishnai I am here because I love to give presentations. You can find me at @vaishnavi.in 3
  • 4. CONTENTS • Introduction to Manipulators • Types of Manipulators • Input manipulators • Output Manipulators • Parameterized manipulators 4
  • 5. INTRODUCTION • Manipulators are operators that are used to format the data display . • It is mainly used for make-up the program. • Manipulators functions are special stream function that changes certain characteristics of the input and output . • To carry out the operations of the manipulators functions in user program, the header file input and output manipulator<iomanip.h> must be included. • Manipulators are the functions specially designed to be used in conjunction with insertion (<<) and extraction (>>) operator on stream object. e.g.- cout<<boolalpha; • Manipulators are used to change formatting parameters on streams and to insert or extract certain special characters.
  • 6. . 6
  • 7. • Ws-The manipulator function ws stands for white space. It is used to ignore the leading white space that precedes the first field. INPUT MANIPULATORS . 7
  • 8. OUTPUT MANIPULATORS i. Endl- The endl is an an output manipulator to generate a carriage return or linefeed character. The endl may be used several times in a c++ statement. Write a newline ('n') and flush buffer. ii. Ends-The ends is a manipulator used to attach a null terminator(‘0’) at the end of a string. The ends manipulator takes no argument whenever it is invoked. This causes a null character to the output. . . 8
  • 9. Continued… iii. Flush -The flush member function is used to cause the stream associated with the output to be completely emptied. This argument function takes no input parameter whenever it is invoked. In case of a disk file being copied to another ,it has to flush the output buffer prior to rewinding the output file for continued use . Flush() does not have anything to do with flushing the input buffer. 9
  • 10. PARAMETRIZEDMANIPULATORS i. Setiosflag- The setiosflag manipulator function is used to control different input and output settings. The IO stream maintains a collection of flag bits. The setiosflag manipulators performs the same function as the setf function. SYNTAX-setiosflag(long f) ii. Resetioflags- It performs the same functions as that of the resetf function . flag represented by the set bits in f are reset. SYNTAX-Resetioflags(long f) 10
  • 11. Continued…. • Setw()-The setw() stands for the ‘setwidth’. The setw() manipulators is used to specify the minimum no. of character position on the output field a variable will consume. SYNTAX-setw (int w) setw(int w) changes the field width to w , but only for the new insertion. the default width is 0. Between the data variables in c ++ space will not be inserted automatic -ally by the compiler .It is upto programmer to introduce proper spaces among data while displaying onto screen. 11
  • 12. Continued…. • Setfill()-To Setfill() manipulator function is used to specify a different character to fill the unused field width of the value. The default fill character is a space. SYNTAX-Setfill(char f) 12
  • 13. Continued…. • Setbase()- Setbase field flag; Sets the base-field to one of its possible values: decimal, hexadecimal or octal according to argument base. 13 std::Setbase (int base); decimal : if base is 10 hexadecimal : if base is 16 octal : if base is 8 zero : if base is any other value.
  • 14. Continued…. • Setprecision-It is used to control the no. of digits of an output stream display of a floating point value . SYNTAX-Setprecision(int p) which set precision for floating point insertion to p. The default precision is 6. 14
  • 15. REFRENCES 15 Object Oriented Programming C++ -E.Balagurusamy Let us C++ -Yashwant Kanetkar Mastering C++ - K.R.Venugopal Programming with C++ -C.Ravichandran