"Wait a tic... Where's the Makefile? I've got just about as much chance of finding it as the FBI does of finding Jimmy Hoffa. Am I just supposed to imagine it into existence?"
I think the point is that the make command can use implicit rules even if there is no Makefile. It knows how to compile C source files. (This could be confusing if you know about "make" but don't know about implicit rules.) For example:
$ ls
hello.c
$ cat hello.c
#include <stdio.h>
int main(void) {
puts("hello");
return 0;
}
$ make hello
cc hello.c -o hello
$ ./hello
hello
$
Later: "So, I'm just supposed to poke in some code, go to my terminal, type this magic 'make' word, and expect a built and working program, right?"
Yes, that's exactly what you're supposed to do. Try it, it should work.
strncpy, when used as designed, can leave the target array without a terminating null character. Using that array later with any string function causes undefined behavior.
strcpy, when used as designed, always leaves the target array properly null-terminated. Using it properly is a bit more difficult; you have to make sure the target array is big enough to hold the source string.
"Wait a tic... Where's the Makefile? I've got just about as much chance of finding it as the FBI does of finding Jimmy Hoffa. Am I just supposed to imagine it into existence?"
I think the point is that the make command can use implicit rules even if there is no Makefile. It knows how to compile C source files. (This could be confusing if you know about "make" but don't know about implicit rules.) For example:
Later: "So, I'm just supposed to poke in some code, go to my terminal, type this magic 'make' word, and expect a built and working program, right?"Yes, that's exactly what you're supposed to do. Try it, it should work.
Part 10 mentions strncpy() as a safer strcpy(). It isn't. http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...
(Disclaimer: I haven't read Zed Shaw's book, and I don't intend to.)