How to implement flags?

Answers were Sorted based on User's Feedback



How to implement flags?..

Answer / subeetha

C++ defines some format flags for standard input and
output, which can be manipulated with the flags(), setf(),
and unsetf() functions. For example,

cout.setf(ios::left);

Is This Answer Correct ?    1 Yes 0 No

How to implement flags?..

Answer / sachin

enum Flag {Yes, No};

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C++ General Interview Questions

Which one of the following describes characteristics of "protected" inheritance? a) The base class has access only to the public or protected members of the derived class. b) The derived class has non-public, inheritable, access to all but the private members of the base class. c) The derived class has access to all members of the base class. d) The private members of the base class are visible within the derived class. e) Public members of the derived class are privately accessible from the base class.

4 Answers   Quark,


What is object in c++ example?

0 Answers  


What do you mean by funtion prototype?

0 Answers  


Explain the need for "Virtual Destructor"?

2 Answers   Infosys,


How does c++ sort work?

0 Answers  






What is c strings syntax?

0 Answers  


How are Structure passing and returning implemented by the compiler?

0 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

0 Answers   CTS,


What is an overflow error?

0 Answers  


Explain register storage specifier.

0 Answers  


Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1

4 Answers   Quark,


How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever

17 Answers   Datavance, Quark, VEL, Wipro,


Categories