how to find the size of a character array in c++

#include <iostream>using namespace std;int main() {char charArray[] = "Hello";int size = sizeof(charArray) / sizeof(charArray[0]);cout << "Size of charArray: " << size << endl;return 0;}