From 60789ab73d4987068114b0342e71a63f81f65c68 Mon Sep 17 00:00:00 2001 From: Oskar Date: Fri, 6 Sep 2024 10:33:29 +0200 Subject: more --- 6p14.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 6p14.cpp (limited to '6p14.cpp') diff --git a/6p14.cpp b/6p14.cpp new file mode 100644 index 0000000..f391697 --- /dev/null +++ b/6p14.cpp @@ -0,0 +1,18 @@ + +/* + * + * 6.14 + * + * + */ + +int main () { + + // It should be a reference when we just want read access to the object and we aren't changing it, we dont have to copy it + // It should be a reference when we want to change the object outside of the function + // It could also be a reference when the object is a type that holds a lot of data and maybe it matters a lot for performance + // If we want to return more information than just one object we could return information through a reference + + // It should not be a reference when we want to change the object inside the function but not outside it + return 0; +} -- cgit v1.2.3