Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Set and clear the showpoint flag

#include <iostream> using namespace std; int main() {   int x = 100;   double f = 98.6;   double f2 = 123456.0;   double f3 = 1234567.0;   // Set the showpoint flag.   cout << "Setting showpoint flag.\n";   cout.setf(ios::showpoint);   cout << "f2 with showpoint set: " << f2 << "\n\n";   cout << "Clearing the showpoint flag.\n\n";   cout.unsetf(ios::showpoint);   return 0; }