#include /* example code for CSE451 section 1 lecture. Use -g while compiling to use GDB with this and then use this to get an understanding of GDB * written by Kurtis Heimerl */ void subRoutine (){ //i return nothing, do nothing but loop for examples sake, use to demonstrate breakpoints int i = 4; while (i > 0){ i--; } } int recursiveThing(int i){ //recursive method, use to demonstrate stack if (i > 0){ return recursiveThing(i-1); } else { return 0; } } int func (int i, char c){ //throwaway function used for the function pointer example return 22; } void funcPoint(int (*pt2Func) (int, char)){ //function pointer example. It takes a function! int answer = (*pt2Func)(12, 'C'); printf("Answer is %i\n", answer); } int main ( int argc, char** argv) { //leh duh printf("Before call\n"); subRoutine(); printf("middle call\n"); recursiveThing(4); printf("function pointer time\n"); funcPoint(func); printf("working?\n"); }