Tuesday, March 15, 2011

next step

I think what I'll do next is compartmentalize things into functions.

The FILE* variable can take care of itself and as long as it's global I won't have too much issue with using fread() in functions. One of my first reader projects passed pointers (and pointers to pointers) into and out of functions but this is really unnecessary, especially for a simple program like this. If the program dealt with multiple files then it might be necessary to pass a file pointer as a function argument.

I'll experiment with sticking to one style of brackets, and I need to decide whether or not to put a space between functions and the parentheses where the passed variables are held. Since I would call a argument-less function like so: function();, with no space between name and parentheses, I should probably do the same for: function(arg1, arg2, arg3);.

No comments:

Post a Comment