c++ char array size

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