C++ File Stream cout

C++ examples for File Stream:cout

Description

Click the following links for the tutorial for File Stream and cout.

  1. Specifying formats with manipulators, number formatting in decimal, octal, and hexadecimal.
  2. Combining the conversion and output for calculation
  3. Manipulating Manipulators
  4. Setting the Width of a Field Using the setw Manipulator or Width Function
  5. Using the Precision Function to Work with the showpoint Format Flag in cout
  6. Lining Up Text Output with setw function
  7. Writing Your Own Stream Manipulators
  8. Formatting Floating-Point Output, show 3 digits to the right, Scientific mode


  9. A generic class for tabular data
  10. Manipulator infrastructure
  11. Set Field Width with width(), setw()
  12. Controlling precision of floating-point values with precision(), setprecision()
  13. Using stream manipulators hex, oct, dec and setbase for Integral Stream Base: dec, oct, hex and setbase
  14. Create User-Defined Output nonparametised Stream Manipulators
  15. Stream Format States and Stream Manipulators
  16. Integral Stream Base: dec, oct, hex, showbase


  17. Using function fill() and setfill() to change the padding character for fields larger than the printed value.
  18. Printing an integer with internal spacing and plus sign, internal, showpos
  19. Left and right justification with stream manipulators left and right.
  20. Controlling the printing of trailing zeros and decimal points in floating-point values, showpoint()
  21. Setting and Resetting the Format State via Member Function flags
  22. Specifying Boolean Format, boolalpha
  23. Uppercase Lowercase Control, uppercase
  24. Floating-Point Numbers, Scientific and Fixed Notation (scientific, fixed)
  25. What is the output of program, cout.scientific
  26. What is the output of program, cout.showpos
  27. What is the output of program, cout.showbase and cout.oct
  28. What is the output of program, cout.setprecision()
  29. What is the output of program, cout.setfill
  30. What is the output of program, cout.width(), cout.fill()
  31. Print integer 40000 left justified in a 15-digit field
  32. Print 200 with and without a sign
  33. Set the Field Width, setw()
  34. Print 1.234 in a 9-digit field with preceding zeros
  35. Print the decimal value 100 in hexidecimal form preceded by 0x
  36. Rounding float value to the nearest digit, tenth, hundredth, thousandth and ten-thousandth.
  37. Converting Fahrenheit to Celsius from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision.
  38. Printing a Table of ASCII Values
  39. Data-scaling algorithm and the curve-plotting routine
  40. Use cout to write to a specific file instead of to the standard display device
  41. Create custom output manipulator and a custom input manipulator called skip_digits().
  42. Create simple parameterized input and output manipulators.
  43. Two basic types of I/O manipulators: parameterless and parameterized.
  44. Show justification format flags, the left, right, and internal format flags.
  45. Line Up Columns of Numbers
  46. Set the field width and the fill character.
  47. Demonstrate setting the precision.
  48. Demonstrate the numeric format flags.
  49. Display the Format Flag Settings
  50. Set and clear format flags.