C++ File Stream stream

C++ examples for File Stream:stream


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

  1. StringStream - read and parse the contents of a file
  2. Controlling format
  3. Using the ifstream class to extract a series of integers:
  4. Constants that Control How Files Are Opened
  5. Default stream objects
  6. Possible file access modes.
  7. Prints to the printer device
  8. Writes the numbers from 1 to 100 to a file called NUMS.1.

  9. Prints a name on the printer.
  10. Using ofstream to Open a text File and Write to It
  11. Returning True When ostream Cannot Create a File
  12. Using Code to Open a File and Read from It
  13. Using Code That Opens a File and Writes to It
  14. Using Code to Write to a File but Not Record a Count
  15. Reading from a File and Looking for the EOF Condition
  16. Specifying a Delimiter with the getline Function

  17. Writing Strings with a Delimiter
  18. Creating a randomly accessed file.
  19. Reading Data from a Sequential File
  20. Creating a Sequential File
  21. Reading Time class objects from a file.
  22. Writing Time class objects to a file.
  23. Converting contents of a stream to upper case.
  24. Removing surplus spaces from a stream.
  25. Reading and writing the primes file
  26. Reading the primes file
  27. Writing primes to a file
  28. Writing Pool objects to a file and reading them back
  29. Writing and reading base and derived class objects
  30. Writing and reading Pool objects in binary mode
  31. Reads and writes several objects to disk
  32. Performs file I/O on Employee objects, handles different sized objects
  33. Demonstrate simple output to printer
  34. Writes formatted output to a file, using <<
  35. Reads formatted output from a file, using >>
  36. Saves person object to disk
  37. Save string to file
  38. Save characters to file
  39. Reads person object from disk
  40. Read string from file
  41. Read character with rdbuf method from a file
  42. Read characters from File
  43. Imitates print command
  44. Writes formatted data into memory
  45. Imitates TYPE command
  46. Save person objects do disk I/O
  47. Write to strstream
  48. Use fstream to read and write a file.
  49. Using seekp( ) and seekg( ) to reverse characters in a file.
  50. Use a string stream to create formatted string
  51. Create a formatted string by use of a string stream.