aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
index eff8980..90127a3 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
@@ -1,4 +1,19 @@
/********************************************************************
+ * Andrei Florea - CST 116 - Chapter 9 - Debugging & Functions
+ *
+ * Chapter 9 Questions & Answers (it didn't specify which questions, so I'm assuming all?)
+ * How does a computer know where to go back to?
+ * - It knows because of a parameter that is called the return address, which lets the computer know
+ * where to go back to after executing the function.
+ *
+ * How does it maintain the state of all variables when a function is called?
+ * - The state of all variables is saved before a function call, and when creating a function,
+ * you can decide whether you want to pass the parameters as reference ( reference to the memory location )
+ * or passing the value of the variable which both can alter the original values, but they differ on how.
+ * Passing by reference, any manipulation inside the function to the given parameter variables will alter it,
+ * but if its passed by value, it has to return the variable(s), as it creates a copy of the original variables.
+ *
+ *
* File: CST116-Ch9-Debugging.cpp
*
* General Instructions: Complete each step before proceeding to the