diff options
| author | Andrei F <[email protected]> | 2022-10-16 17:49:59 -0700 |
|---|---|---|
| committer | Andrei F <[email protected]> | 2022-10-16 17:49:59 -0700 |
| commit | 056e89fec2e9d29a33932c9ddd55447a455d82bd (patch) | |
| tree | 66773675a4a1506de9906feab53d5e17d13f985e | |
| parent | Adding git ignore file (diff) | |
| download | cst116-ch9-debugging-florea-056e89fec2e9d29a33932c9ddd55447a455d82bd.tar.xz cst116-ch9-debugging-florea-056e89fec2e9d29a33932c9ddd55447a455d82bd.zip | |
Finished chapter9 questions
| -rw-r--r-- | .idea/.gitignore | 8 | ||||
| -rw-r--r-- | .idea/.name | 1 | ||||
| -rw-r--r-- | .idea/cst116-ch9-debugging-florea.iml | 2 | ||||
| -rw-r--r-- | .idea/misc.xml | 4 | ||||
| -rw-r--r-- | .idea/modules.xml | 8 | ||||
| -rw-r--r-- | .idea/vcs.xml | 6 | ||||
| -rw-r--r-- | CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 15 |
7 files changed, 44 insertions, 0 deletions
diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..3d1f044 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +cst116_ch9_debugging_florea
\ No newline at end of file diff --git a/.idea/cst116-ch9-debugging-florea.iml b/.idea/cst116-ch9-debugging-florea.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/cst116-ch9-debugging-florea.iml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module classpath="CMake" type="CPP_MODULE" version="4" />
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" /> +</project>
\ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5c0253a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/cst116-ch9-debugging-florea.iml" filepath="$PROJECT_DIR$/.idea/cst116-ch9-debugging-florea.iml" /> + </modules> + </component> +</project>
\ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project>
\ No newline at end of file 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
|