gcc 4.4.4 c89
I got into a recent discussion about \"fixed width strings\" and \"zero terminated strings\".
When I think about this. They seem to be the same
First of all, I think you mean fixed length string, not fixed with string.
Second, the above is a null terminated string. It shouldn't be changed because of its definition as a literal constant.
AFAIK C doesn't have any real "fixed length strings". At best, you could define a buffer of size N and place no more than N-1 characters in it, where placing more would be an error and forgetting the null terminator can be an error.
As for strncpy, what it does is that it copies the specified number of characters, and zero pads the rest. This means that if the destination is not long enough, you would either be writing past the available space, or would not have a null terminator to your string, leading to errors when you attempt to use the string.