In this statement
if(a == b){
cout << "worked\n";
}
a and b are implicitly converted to pointers to first elements of the corresponding arrays. So there is a comparison of two pointers. As the arrays occupy different areas in memory then the condition will be alwasy equal to false.
There is no such an operation as the comparison for arrays. To compare two arrays you have toc compare all elements of the arrays with each other. For example you could use standard algorithm std::equal. For example
if( std::equal( std::begin( a ), std::end( a ), std::begin( b ) ) ){
cout << "worked\n";
}
Another approach is to use standard container std::array that has the comparison operator. For example
std::array<char, 2> a = { 'a', 'b' };
std::array<char, 2> b = { 'a', 'b' };
if(a == b){
cout << "worked\n";
}