From 9b73f5889937d88796b45126f6165027fecd3436 Mon Sep 17 00:00:00 2001 From: Oskar Date: Fri, 6 Sep 2024 15:37:57 +0200 Subject: more --- 6p18.cpp | 6 ++++-- 6p19.cpp | 22 ++++++++++++++++++++-- 6p20.cpp | 9 +++++++-- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/6p18.cpp b/6p18.cpp index 58d5fbf..1d0bc41 100644 --- a/6p18.cpp +++ b/6p18.cpp @@ -1,12 +1,14 @@ -#include /* * - * Description + * 6.18 * * */ int main () { + + // bool compare(matrix &rm1, matrix &rm2); + // std::vector::iterator change_val(int i, std::vector::iterator iter); return 0; } diff --git a/6p19.cpp b/6p19.cpp index 58d5fbf..af813f4 100644 --- a/6p19.cpp +++ b/6p19.cpp @@ -1,12 +1,30 @@ -#include /* * - * Description + * 6.19 * * */ int main () { + + /* + double calc(double); + int count(const string &, char); + int sum(vector::iterator, vector::iterator, int); + vector vec(10); + + (a) + calc(23.4, 55.1); // illegal, only 1 argument + + (b) + count("abcda", ’a’); // legal + + (c) + calc(66); // legal + + (d) + sum(vec.begin(), vec.end(), 3.8); // legal + */ return 0; } diff --git a/6p20.cpp b/6p20.cpp index 58d5fbf..c2b0b0b 100644 --- a/6p20.cpp +++ b/6p20.cpp @@ -1,12 +1,17 @@ -#include /* * - * Description + * 6.20 * * */ int main () { + + /* + We should do it when we only need to read the data. + There is no point accidentally writing to something we did not intend to write to. + Because if we had used const we would not be allowed to. + */ return 0; } -- cgit v1.2.3