Jim's
Tutorials

Spring 2013
course
navigation

April 12 C

I read chapters 9 and 10: functions, arrays in functions, program organization, basic docstrings, and global variables.
Exercises coming in a few days.
Here's a thing I'm wondering, and its really one of the keys to learning how to learn from a textbook (or other comparable source): which exercises do I do? On what basis do I select them? How many? This is actually one of the things I find most hard about (semi) autodidactic learning. But I guess that is really what I'm trying to get better at at Marlboro - the "liberal (science) arts" aspect of what I'm doing.
What do you think?
Here's the code I e-mailed you, below - its seg faulting. Maybe this would be a good time to go over how to debug with gdb?

Jim

In class we re-wrote this so that
We also did a short example session with the debugger :
$ gcc -g selection_lib.c selection_main.c -o selection_sort $ gdb selection_sort (gdb) start # get the program going (gdb) list # see the C code where we are (gdb) print variable # see something (gdb) set variable=new # change something (gdb) step # execute one line (gdb) break function_name # set stopping place (gdb) continue # keep going until next stopping place
http://cs.marlboro.edu/ courses/ spring2013/jims_tutorials/ cory/ April_12_C
last modified Friday April 19 2013 12:43 pm EDT

attachments [paper clip]

     name last modified size
[COD]selection_lib.c Apr 19 2013 12:39 pm 1.07kB    selection_lib.h Apr 19 2013 12:42 pm 269B [COD]selection_sort.c Apr 19 2013 12:39 pm 1.19kB