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

Define a nested class. Explain how it can be useful.

0 Answers  


what is data abstraction in C++?

0 Answers  


What are the five types of inheritance in C++?

1 Answers  


What is input operator in c++?

0 Answers  


How would you implement a substr() function that extracts a sub string from a given string?

0 Answers  






Can you please explain the difference between using macro and inline functions?

0 Answers  


Which software is best for programming?

0 Answers  


What is scope of a variable? (LOLZ)

2 Answers   CA, TCS,


What is name hiding in c++?

0 Answers  


How did c++ start?

0 Answers  


What is the difference between map and hashmap in c++?

0 Answers  


Why #include is used?

0 Answers  


Categories