diff options
Made some pointers constant
1 files changed, 3 insertions, 3 deletions
| -rw-r--r-- | Year 1/Programming introduction/Homeworks/homework1.cpp | 6 |
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) |
