Skip to content

My solutions to exercises that are presented in chapters 3-17 of the book C Primer Plus, 6th edition by Stephen Prata

License

Notifications You must be signed in to change notification settings

scvua/c-primer-plus-prata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solutions to exercises from the "C Primer Plus" by Stephen Prata

This repository contains my solutions to exercises presented in the C Primer Plus, 6th edition by Stephen Prata. All solutions was compiled and tested on macOS High Sierra (ver.10.13.6), Xcode 10.1, using the clang compiler Apple LLVM version 10.0.0 (clang-1000.11.45.5).

Sections

Extras

Extras Folder contains my test programs or experiments:

  • filecopy.c: implementation of the ex11_02 with getc() and putc() functions.
  • persons.c: a warm-up program before doing ex14_07.
  • printer.c: prints contents of the text file, but replaces each invisible \n character with the visible \n output.
  • revstr.c: the revstr() function (ex11_09) with a temporary VLA array.
  • spacer.c: inserts whitespace characters between the characters of the text file.

Data and Test Files

Data Folder contains text and data files. Files with .dat extension are the parts of some exercises and contain the data for the program execution.
Text files are provided to support manually testing the exercises.

  • /flights: the folder contains data files for the ex14_09 execution. Each file has the data of the Colossus Airlines flight with the corresponding flight number.
  • alice_in_wonderland.txt: project Gutenberg's "Alice's Adventures in Wonderland", by Lewis Carroll
  • alphabet.txt: 26 lines with the alphabetic characters.
  • book.dat: the books database for ex14_07.
  • digits.spaced.txt: input file for ex13_12, ex13_13, and ex13_14. The file was created by applying spacer.c on digits.txt.
  • digits.txt: 20x30 digits file with no spaces.
  • fewlines.txt: few lines of the text.
  • flight.dat: the database for the first Colossus Airlines flight (ex14_08).
  • movies.txt: 11 "movies" to input for ex17_01 - ex17_03
  • persons.dat: is used by persons.c (feed the address to the file as a command-line argument).
  • softball.txt: the softball team statistics, for use with the ex14_06.
  • words.txt: the text file on which I tested ex17_07.

License

These solutions are copyright under the terms of the MIT LICENSE (see LICENSE) with the following exception:

  • The source code of this project is directly the answers for the exercises presented in the book "C Primer Plus, 6th edition" by Stephen Prata (2014). The text of most of the opening comments of the solutions, which contain the exercise conditions, can partially or completely recite the corresponding fragments of the book with the original exercise conditions. Therefore, before-mentioned fragments of comments fall under the influence of the publisher's copyright.

About

My solutions to exercises that are presented in chapters 3-17 of the book C Primer Plus, 6th edition by Stephen Prata

Topics

Resources

License

Stars

Watchers

Forks