When should I use unitbuf flag?



When should I use unitbuf flag?..

Answer / Alok Narayan Pandey

The ios_base::sync_with_stdio(false) and std::cout.setf(std::ios::unitbuf) are used together in C++ to ensure that output operations on cout flush the buffer immediately after each operation, instead of buffering them for efficiency. This is useful when mixing C and C++ streams or dealing with interactive input/output.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Is swift faster than go?

1 Answers  


Is c++ low level?

1 Answers  


What is the use of typedef?

1 Answers  


an operation between an integer and real always yeilds a) integer result b) real result c) float result

1 Answers  


What are signs of manipulation?

1 Answers  


How to construct virtual constructor

6 Answers   CIStems Software, Symphony,


Distinguish between a # include and #define.

1 Answers  


What do you mean by overhead in c++?

1 Answers  


Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

2 Answers  


What is #include iostream in c++?

1 Answers  


Program to check whether a word is a sub-string or not of a string typed

1 Answers  


Which compiler does turbo c++ use?

1 Answers  


Categories