Monday 17 February 2020

Chapter 10 // Exercise 8 - Principles & Practice Using C++

In this exercise I am using Visual Studio Community 2017 and the header file "std_lib_facilities.h" which can be found here:

http://www.stroustrup.com/Programming/PPP2code/std_lib_facilities.h

Chapter 10 // Exercise 8

Write a program that accepts two file names and produces a new file that is the contents of the first file followed by the contents of the second; that is, the program concatenates the two files.


Ah, a nice and easy one. I also really love using substr(), it has so many useful applications, like checking to see if a certain part of a string matches another string. I also found that you can easily copy files into another by using the .rdbuf() function. It contains a pointer to the contents of the file for easy access.

No comments:

Post a Comment