In this video, see a solution to this chapter's challenge.
(upbeat music)…- Let's take a look at this solution to the problem,…and this is how we'll do it.…First I will guide you through the code…so that you can understand how I'm using the functions,…and next I will create a new file,…and write some text in it so that I can run the application,…and show you how it was successfully copied.…So let's get started.…
As you can see, I only have one main function…starting at line three, and the first thing I do…is declare two strings.…One is called source.…The next one is called target,…and they are both 50 characters long.…So in line six, I am asking the user…for a source file name with a print F function call.…And next, in line seven, I am using scan F…to get that string into source.…I'm doing the same in lines eight and nine…for the target file name.…
Now, in lines 11 and 12, that's where I'm creating…the file descriptors with F open, and I am using the source…and target file names respectively,…but notice how, in line 11, I am using the R access mode…whereas in line 12, I am using the W access mode.…
- Working with header files
- C constants and types
- Unformatted and formatted input/output
- Accessing files with C functions
- Generating random numbers
- Converting strings
- Sorting and searching for data
- Manipulating strings
- Using mathematical functions
Skill Level Intermediate
C++ Standard Template Librarywith Eduardo Corpeño2h 23m Advanced
1. The C Standard Library
2. Input and Output Library: stdio.h
3. General Purpose: stdlib.h
4. String Functions: string.h
5. Mathematical Functions: math.h
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.