cpp:osteams

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cpp:osteams [2020/05/17 18:16]
gthanos
cpp:osteams [2020/05/17 19:03]
gthanos [std::ios::floatfield]
Line 48: Line 48:
 int main() { int main() {
   cout.setf(std::ios::hex, std::ios::basefield);   cout.setf(std::ios::hex, std::ios::basefield);
-  cout << 16 << endl;+  cout << "0x" <<16 << endl;
 } }
 </code> </code>
Line 155: Line 155:
      
   /* no special formatting specified */   /* no special formatting specified */
 +  cout << 0.00000123456789012345678 << endl;
 +  cout << 0.0000123456789012345678 << endl;
 +  cout << 0.000123456789012345678 << endl;
 +  cout << 0.00123456789012345678 << endl;
 +  cout << 0.0123456789012345678 << endl;
   cout << 0.123456789012345678 << endl;   cout << 0.123456789012345678 << endl;
   cout << 123.4567890123456789 << endl;   cout << 123.4567890123456789 << endl;
Line 160: Line 165:
   cout << 123456789.0123456789 << endl;   cout << 123456789.0123456789 << endl;
      
-  cout << fixed << endl; +  cout << std::fixed << endl; 
-  cout << setprecision(1) << 123.456 << endl; +  cout << std::setprecision(1) << 123.456 << endl; 
-  cout << setprecision(2) << 123.456 << endl; +  cout << std::setprecision(2) << 123.456 << endl; 
-  cout << setprecision(3) << 123.456 << endl; +  cout << std::setprecision(3) << 123.456 << endl; 
-  cout << setprecision(4) << 123.456 << endl; +  cout << std::setprecision(4) << 123.456 << endl; 
-  cout << setprecision(5) << 123.456 << endl; +  cout << std::setprecision(5) << 123.456 << endl; 
-  cout << setprecision(6) << 123.456 << endl; +  cout << std::setprecision(6) << 123.456 << endl; 
-  cout << setprecision(7) << 123.456 << endl;+  cout << std::setprecision(7) << 123.456 << endl;
      
-  cout << scientific << endl; +  cout << std::scientific << endl; 
-  cout << setprecision(1) << 123.456 << endl; +  cout << std::setprecision(1) << 123.456 << endl; 
-  cout << setprecision(2) << 123.456 << endl; +  cout << std::setprecision(2) << 123.456 << endl; 
-  cout << setprecision(3) << 123.456 << endl; +  cout << std::setprecision(3) << 123.456 << endl; 
-  cout << setprecision(4) << 123.456 << endl; +  cout << std::setprecision(4) << 123.456 << endl; 
-  cout << setprecision(5) << 123.456 << endl; +  cout << std::setprecision(5) << 123.456 << endl; 
-  cout << setprecision(6) << 123.456 << endl; +  cout << std::setprecision(6) << 123.456 << endl; 
-  cout << setprecision(7) << 123.456 << endl;+  cout << std::setprecision(7) << 123.456 << endl;
      
-  cout << showpoint << endl;+  cout << std::showpoint << endl;
   cout << 30 << " " <<  1000L << " " << 1000.00 << " " << 3.14159;   cout << 30 << " " <<  1000L << " " << 1000.00 << " " << 3.14159;
-  cout << noshowpoint << endl;+  cout << std::noshowpoint << endl;
   cout << 30 << " " << 1000L << " " << 1000.00 << " " << 3.14159;   cout << 30 << " " << 1000L << " " << 1000.00 << " " << 3.14159;
-  +  cout << endl;
 } }
 </code> </code>
cpp/osteams.txt · Last modified: 2020/05/17 18:10 (external edit)