SlideShare a Scribd company logo
1 of 15
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

What's hot (20)

Functions in c
Functions in cFunctions in c
Functions in c
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Files in c++
Files in c++Files in c++
Files in c++
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Formatted input and output
Formatted input and outputFormatted input and output
Formatted input and output
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Console i/o for c++
Console i/o for c++Console i/o for c++
Console i/o for c++
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Union in C programming
Union in C programmingUnion in C programming
Union in C programming
 
Enums in c
Enums in cEnums in c
Enums in c
 
Function in C
Function in CFunction in C
Function in C
 
Strings in C
Strings in CStrings in C
Strings in C
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Scope rules : local and global variables
Scope rules : local and global variablesScope rules : local and global variables
Scope rules : local and global variables
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
 

Similar to Manipulators Guide

Managing console input and output
Managing console input and outputManaging console input and output
Managing console input and outputgourav kottawar
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++Haripritha
 
C programming session 01
C programming session 01C programming session 01
C programming session 01Dushmanta Nath
 
C programming language
C programming languageC programming language
C programming languageAbin Rimal
 
[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evansWeb-Desegner
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesssuserf86fba
 
C Programming ppt for beginners . Introduction
C Programming ppt for beginners . IntroductionC Programming ppt for beginners . Introduction
C Programming ppt for beginners . Introductionraghukatagall2
 
Here is The code in C language .pdf
Here is The code in C language  .pdfHere is The code in C language  .pdf
Here is The code in C language .pdfgeetakannupillai1
 
Handout2.pdf
Handout2.pdfHandout2.pdf
Handout2.pdfShoukat13
 
FILE OPERATIONS.pptx
FILE OPERATIONS.pptxFILE OPERATIONS.pptx
FILE OPERATIONS.pptxDeepasCSE
 
Modify the code in C Please .pdf
Modify the code in C Please .pdfModify the code in C Please .pdf
Modify the code in C Please .pdfadityaenterprise32
 
Please write it in C not python .pdf
Please write it in C not python .pdfPlease write it in C not python .pdf
Please write it in C not python .pdfabhisheksharmasre
 

Similar to Manipulators Guide (20)

Managing console input and output
Managing console input and outputManaging console input and output
Managing console input and output
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
C programming language
C programming languageC programming language
C programming language
 
[Apostila] programação arduíno brian w. evans
[Apostila] programação arduíno   brian w. evans[Apostila] programação arduíno   brian w. evans
[Apostila] programação arduíno brian w. evans
 
C++ Ch3
C++ Ch3C++ Ch3
C++ Ch3
 
Managing I/O in c++
Managing I/O in c++Managing I/O in c++
Managing I/O in c++
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequences
 
C Programming ppt for beginners . Introduction
C Programming ppt for beginners . IntroductionC Programming ppt for beginners . Introduction
C Programming ppt for beginners . Introduction
 
Here is The code in C language .pdf
Here is The code in C language  .pdfHere is The code in C language  .pdf
Here is The code in C language .pdf
 
C
CC
C
 
Basic commands in C++
Basic commands in C++Basic commands in C++
Basic commands in C++
 
Handout2.pdf
Handout2.pdfHandout2.pdf
Handout2.pdf
 
Embedded C programming session10
Embedded C programming  session10Embedded C programming  session10
Embedded C programming session10
 
Lesson 4.1 completing the problem solving process
Lesson 4.1 completing the problem solving processLesson 4.1 completing the problem solving process
Lesson 4.1 completing the problem solving process
 
FILE OPERATIONS.pptx
FILE OPERATIONS.pptxFILE OPERATIONS.pptx
FILE OPERATIONS.pptx
 
Modify the code in C Please .pdf
Modify the code in C Please .pdfModify the code in C Please .pdf
Modify the code in C Please .pdf
 
Please write it in C not python .pdf
Please write it in C not python .pdfPlease write it in C not python .pdf
Please write it in C not python .pdf
 
Managing console input
Managing console inputManaging console input
Managing console input
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 

Manipulators Guide

  • 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