C++ iomanip flush














































C++ iomanip flush



FLUSH MANIPULATOR FUNCTION

The flush manipulator function is used to completely vacant the output stream. This function takes in no arguments or parameters. This function is not that of a much significance when normal output is printed on the output console. But when output is used for different reasons where it is very important to clear the output stream buffer, like in case of file handling where the output buffer has to be cleared repeatedly, it can be used. flush function does not alter input stream.

Code:
// using flush function
#include<iostream> #include<iomanip> using namespace std; int main() { cout<<"My name is Abhinav Verma \n"; cout.flush(); //flushes the output stream cout<<"I am typing \n"; cout.flush(); return 0; }

The screenshot showing the flush function is shown below:








More Articles of Abhinav Verma:

Name Views Likes
C++ Loki Abstract Factory Implementation 525 1
C++ Loki SmallObject Compiler Working 351 1
C++ Loki SmallObject 354 1
C++ Loki Abstract Factory Interface 413 1
C++ Loki Double Dispatching 304 2
C++ Loki SmallObjAllocator 297 2
C++ Loki Abstract Factory 302 2
C++ Loki Small Objects Allocation Methods 247 1
C++ Loki The Fixed Size Allocator 323 1
C++ Loki Necessity of Multi-Methods 219 1
C++ Loki Chunks 270 1
C++ Loki Packing Order of Small Object Allocator 238 2
C++ Loki Multimethods Polymorphism 243 2
C++ Loki How does memory allocator works? 230 1
C++ Loki Default Storage Allocator 234 1
C++ Loki Multimethods 301 1
C++ Loki Small Object Allocator 250 1
C++ Loki Techniques Compile Time Affirmations 226 1
C++ Loki Typelist Linear Hierarchy 213 1
C++ Loki Techniques type_info 190 1
C++ Loki Traits Generating Tuples 199 1
C++ Loki Techniques Partial Template Specialization 209 1
C++ Loki Typelist Generating Scattered Hierarchy 248 1
C++ Loki Techniques Select 206 1
C++ Loki Clubbing TypeList 199 1
C++ Loki Techniques Traits 188 1
C++ Loki TypeList Substituting Elements 198 1
C++ Loki Techniques Local Classes 197 1
C++ Loki TypeList Deleting Duplicated 181 1
C++ Loki Techniques Introduction 185 1
C++ Loki Effacing type from typelist 203 1
C++ Loki Append TypeList 191 1
C++ Loki Mouldering Classes 191 1
C++ Loki Searching TypeList 190 1
C++ Loki Smart Pointer Compatibility of Policies 207 1
C++ Loki TypeList Indexed Access 201 1
C++ Loki Smart Pointer Structure Customization 196 1
C++ Loki Length of TypeList 200 1
C++ Loki Smart Pointer Threading Model and Checking Policy 195 1
C++ Loki Voluntary Functionality through Incomplete Initialization 174 1
C++ Loki Policy Class Destructor 207 1
C++ Loki Enriched Policies 184 1
C++ Loki Policy Classes with Template Template Parameter and Member functions 183 1
C++ Loki Kernel of Policy Classes 188 1
C++ Loki Templates in design 194 1
C++ Loki Do-it-All Interface & Multiple Inheritance 194 1
C++ Loki Policy Based Design 249 2
C++ Loki Introduction 253 2
C++ iomanip ends 219 1
C++ iomanip flush 230 2
C++ iomanip ws 264 2

Comments