C
You're viewing a free preview. Sign in free to read every script.
Why this exists C has no string type. A string is an array of char that ends with a zero byte ('\0'), and every string function depends on that terminator being there. Forget it, or write past the end of the array, and…
C Basics: Arrays and Strings
Arrays, C strings as null-terminated character arrays, the string functions you will use daily, and the classic pitfalls: strncpy does not terminate, == compares addresses, and unchecked copies overflow. Includes safe copying with snprintf.
Sign in free to read this script, along with the rest of the library.
Sign in free