Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Arrays of the char type. They are used to represent text in C-style, ending with a special null terminator \0.
char name[6] = "Alice"; // Auto adds \0
char city[] = {'N', 'Y', '\0'}; // Manual \0
cout << sizeof(name); // 6 (including \0)cin stops at spaces. Use cin.get() or getline() for strings with spaces.
Writing more characters than the array size can overwrite adjacent memory.
strlen()strcpy()strcat()strcmp()