I believe Array1 and Array2 are declared differently but they both do have the same type - char. Both Array1 and Array2 seem to contain the same exact values and the same amount of values. I don't understand why their length are different from each other. Can someone please explain why?
char Array1[ ] = { 1, 2, 3, 4, 5 };
char Array2[ ] = "\x01\x02\x03\x04\x05";
std::cout << "Length of Array1 = " << sizeof( Array1 )/sizeof( *Array1 )
<< std::endl
<< "Length of Array2 = " << sizeof( Array2 )/sizeof( *Array2 );
Output:
Length of Array1 = 5
Length of Array2 = 6