4 ms·
I too have been doing this with Zed Shaw's work. My biggest piece of advice is this: make sure you read the code and try to understand it before you type it in.
by jdreaver 14y ago
I too have been doing this with Zed Shaw's work. My biggest piece of advice is this: make sure you read the code and try to understand it before you type it in. When you are given
char *names[] = {"Bob", "Dole", "Bananas"};
don't just write out the text as you see it (which is what I did too often). Think through and say "ok, I am creating a variable called names. There are brackets, so it must be an array, and there is an asterisk after char, so it must be an array of pointers to char. Then I construct it with string literals..."
I caught myself writing whole source files from a book without understanding a single line. I agree with danielweber when he says to try and reproduce the code before typing it out verbatim.