Mega Code Archive

 
Categories / C++ / Data Type
 

Set showpos flag for decimal

#include <iostream> using namespace std; int main() {   int x = 100;   double f = 98.6;   double f2 = 123456.0;   double f3 = 1234567.0;   // Set the showpos flag.   cout.setf(ios::showpos);   cout << "Setting showpos flag.\n";   cout << "x in decimal after setting showpos: " << x << endl;   return 0; }