File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
Chapter 08 - Using Multiple Files
Chapter 11 - Standard Algorithms Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -94,5 +94,13 @@ int main() {
94
94
std::cout << " " << e;
95
95
std::cout << " \n " ;
96
96
97
- return 0 ;
97
+ // By the way, we've been writing return 0; at the end of every main
98
+ // function. As I said before, the main function is weird: for example, you
99
+ // can't call it from inside your program. Another (nice) quirk it has is
100
+ // that you are allowed to omit the return statement at the end, and the
101
+ // compiler will assume you returned 0. This means we can stop writing it
102
+ // out now and let the compiler do the work.
103
+ //
104
+ // As you may have noticed, I'm extremely lazy and love letting software do
105
+ // work for me.
98
106
}
Original file line number Diff line number Diff line change @@ -31,6 +31,4 @@ int main() {
31
31
else
32
32
std::cout << i << " was not amongst the numbers you entered.\n " ;
33
33
}
34
-
35
- return 0 ;
36
34
}
Original file line number Diff line number Diff line change @@ -289,6 +289,4 @@ int main() {
289
289
for (auto e : filter_greater_than (v, 5 ))
290
290
std::cout << " " << e;
291
291
std::cout << " \n " ;
292
-
293
- return 0 ;
294
292
}
Original file line number Diff line number Diff line change @@ -75,6 +75,4 @@ int main() {
75
75
std::cout << " Your input, sorted using a custom comparison function: " ;
76
76
display_range (v.begin (), v.end ());
77
77
std::cout << " \n " ;
78
-
79
- return 0 ;
80
78
}
You can’t perform that action at this time.
0 commit comments