Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Before std::string, C++ used arrays of characters terminated by a special null character \0.
char str[] = "Hello";
// Memory: ['H', 'e', 'l', 'l', 'o', '\0']
char str2[6] = {'H', 'e', 'l', 'l', 'o', '\0'};strlen(s): Returns length (excluding null).strcpy(dest, src): Copies src to dest.strcmp(s1, s2): Compares two strings lexicographically.strcat(dest, src): Appends src to end of dest.C-style strings are prone to Buffer Overflows because they don't track their own size. In modern C++, always prefer std::string.