Skip to content

Commit 1f2a66d

Browse files
committed
Ch04 updates
1 parent 8e54df7 commit 1f2a66d

File tree

8 files changed

+6
-9
lines changed

8 files changed

+6
-9
lines changed

examples/ch04/fig04_04.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main() {
2121
// calculate amount on deposit for each of ten years
2222
for (int year{1}; year <= 10; ++year) {
2323
// calculate amount on deposit at the end of the specified year
24-
double amount = principal * pow(1.0 + rate, year);
24+
double amount{principal * pow(1.0 + rate, year)} ;
2525

2626
// display the year and the amount
2727
cout << setw(4) << year << setw(20) << amount << endl;

examples/ch04/fig04_06.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main() {
5959
// if user entered at least one grade...
6060
if (gradeCounter != 0) {
6161
// calculate average of all grades entered
62-
double average = static_cast<double>(total) / gradeCounter;
62+
double average{static_cast<double>(total) / gradeCounter};
6363

6464
// output summary of results
6565
cout << "Total of the " << gradeCounter << " grades entered is "

examples/ch04/fig04_11.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int main() {
1010
string zipFileName;
1111
getline(cin, zipFileName); // inputs a line of text
1212

13-
// strings literals separated only by whitespace are combined
13+
// string literals separated only by whitespace are combined
1414
// into a single string by the compiler
1515
string content{
1616
"This chapter introduces all but one of the remaining control "
@@ -29,9 +29,9 @@ int main() {
2929

3030
miniz_cpp::zip_file output; // create zip_file object
3131

32-
// write content into a text file in outputZipFile
32+
// write content into a text file in output
3333
output.writestr("intro.txt", content); // create file in ZIP
34-
output.save(zipFileName); // save outputZipFile to zipFileName
34+
output.save(zipFileName); // save output to zipFileName
3535

3636
miniz_cpp::zip_file input{zipFileName}; // load zipFileName
3737

examples/ch04/fig04_12/fig04_12.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ int main() {
1818

1919
// calculate amount on deposit for each of ten years
2020
for (int year{1}; year <= 10; ++year) {
21-
// calculate amount on deposit at the end of the specified year
22-
double amount = principal * pow(1.0 + rate, year);
23-
24-
// display the year and the amount
21+
double amount{principal * pow(1.0 + rate, year)};
2522
cout << format("{:>4d}{:>20.2f}\n", year, amount);
2623
}
2724
}

examples/libraries/cereal-1.3.0/sandbox/sandbox_shared_lib/base.cpp

100644100755
File mode changed.

examples/libraries/cereal-1.3.0/sandbox/sandbox_shared_lib/base.hpp

100644100755
File mode changed.

examples/libraries/cereal-1.3.0/sandbox/sandbox_shared_lib/derived.cpp

100644100755
File mode changed.

examples/libraries/cereal-1.3.0/sandbox/sandbox_shared_lib/derived.hpp

100644100755
File mode changed.

0 commit comments

Comments
 (0)