From 237bac8e9055e49a2b7ed12d7e65c7db031e2b26 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 24 Nov 2021 17:27:55 +0200 Subject: Made some pointers constant --- Year 1/Programming introduction/Homeworks/homework1.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Year 1/Programming introduction/Homeworks/homework1.cpp') diff --git a/Year 1/Programming introduction/Homeworks/homework1.cpp b/Year 1/Programming introduction/Homeworks/homework1.cpp index d9541eb..c64f169 100644 --- a/Year 1/Programming introduction/Homeworks/homework1.cpp +++ b/Year 1/Programming introduction/Homeworks/homework1.cpp @@ -49,7 +49,7 @@ void printPointLocation(double x, double y) { { double pointSlope = y / x; - // Brackets in some places for improved readability + // Added brackets in some places for improved readability if (eq(x, -CROSS_PNT) || eq(x, CROSS_PNT) || eq(pointSlope, SLOPE_BC) || (eq(pointSlope, SLOPE_DE) && mt(y, 0))) { cout << NOWHERE << endl; // On a line @@ -122,14 +122,14 @@ void ex1() * Exercise 2 */ -void setMarmaladeType(unsigned int type, unsigned int *blueberryMarmalades, unsigned int *peachMarmalades, unsigned int *rosehipMarmalades) +void setMarmaladeType(unsigned int type, unsigned int* const blueberryMarmalades, unsigned int* const peachMarmalades, unsigned int* const rosehipMarmalades) { if (type % 7 == 0) *blueberryMarmalades += 1; else if (type % 13 == 0) *peachMarmalades += 1; else if (type % 17 == 0) *rosehipMarmalades += 1; } -void readCodesAndCountMarmalades(unsigned int archiveLength, unsigned int *blueberryMarmalades, unsigned int *peachMarmalades, unsigned int *rosehipMarmalades) +void readCodesAndCountMarmalades(unsigned int archiveLength, unsigned int* const blueberryMarmalades, unsigned int* const peachMarmalades, unsigned int* const rosehipMarmalades) { archiveLength -= archiveLength % 8; // The last code could be invalid (shorter than 8 digits) -- cgit v1.3.1-23-gd82d