c++ char array size
- Declare a character array in C++:
char myArray[10];
- Initialize the character array with a string:
char myArray[] = "Hello";
- Access and modify individual characters in the array:
myArray[0] = 'W'; // Changes the first character to 'W'
- Get the size of the character array:
int size = sizeof(myArray) / sizeof(myArray[0]);