在C和C++中,操作字符串很容易产生错误。最常见的错误有4种,分别是无界字符串复制(unbounded string copy)、差一错误(off-by-one error)、空结尾错误(null termination error)以及字符串截断(string truncation)。