C++ File Stream File Operation

C++ examples for File Stream:File Operation


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

  1. Copy one file to another, a line at a time
  2. Read an entire file into a single string
  3. Break a file into whitespace-separated words
  4. Copy an entire file into a vector of string
  5. File Copy - make backup copies of the files passed to the program
  6. Makes a copy of a file.
  7. Reads and displays a file.
  8. Possible origin values during file access.

  9. Delete the file specified by the user.
  10. Using Code to Open a File and Read It Back In
  11. Using Code to Open a text File and Write to It
  12. Renames a file
  13. Copying a File
  14. Getting Information About a File
  15. Deleting or Renaming a File
  16. Creating a temporary filename

  17. Creating a Temporary Filename and File
  18. Replacing a File Extension
  19. Extracting a File Extension from a String
  20. File Matching
  21. Search word in files
  22. Copying files
  23. Checks for errors opening file
  24. Handles errors during file input and output
  25. Seeks particular person in file
  26. Imitates COPY command using file stream
  27. Displays size of file
  28. File Status Functions
  29. File open mode
  30. Open a file and check its status
  31. Open file in input mode to see whether it exists.
  32. Read a file before the EOF has been read.
  33. Open file to read in a function
  34. Open a file in read mode and includes exception handling.
  35. Creates the info.bak file as a duplicate of the info.txt file
  36. Simple File-Comparison Utility
  37. Check file read status
  38. Using random-access I/O to read specific records from a data file.
  39. Using peek( ), unget( ), and ignore() to read file
  40. C based file I/O, copy a file, substituting spaces for tabs in the process.
  41. Demonstrate rename() and remove() on file