CC · Lesson 5 of 8
Arrays & Strings
In C, a string is just an array of characters ending with a null byte (\0). This is either elegant or terrifying. Reader's choice.
⚠ Warning
Buffer overflows are C's most famous security vulnerability. Never use strcpy() with untrusted input — use strncpy() or snprintf() instead. Always make sure your buffers are large enough for the data plus the null terminator.
Buffer overflows are C's most famous security vulnerability. Never use strcpy() with untrusted input — use strncpy() or snprintf() instead. Always make sure your buffers are large enough for the data plus the null terminator.