Binary file handouts/ho03.pdf has changed
--- a/handouts/ho03.tex Tue Oct 07 00:12:29 2014 +0100
+++ b/handouts/ho03.tex Tue Oct 07 00:15:41 2014 +0100
@@ -154,7 +154,8 @@
\item \texttt{(l)ist n} -- listing the source file from line
\texttt{n}
\item \texttt{disassemble fun-name}
-\item \texttt{run} -- starts the program
+\item \texttt{run args} -- starts the program, potential
+arguments can be given
\item \texttt{(b)reak line-number} -- set break point
\item \texttt{(c)ontinue} -- continue execution until next
breakpoint in a line number
--- a/progs/C1.c Tue Oct 07 00:12:29 2014 +0100
+++ b/progs/C1.c Tue Oct 07 00:15:41 2014 +0100
@@ -1,17 +1,20 @@
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
void dead () {
printf("I will never be printed!\n");
exit(1);
}
+void foo(char *bar) {
+ char buffer[8];
+ strcpy(buffer, bar);
+}
int main(int argc, char **argv) {
- char buffer[8];
- dead();
- strcpy(buffer, argv[1]);
+ foo(argv[1]);
return 1;
}