Why does the array element b[2] only output one character? How do I make it to output both b and a instead of just a?Code:#include <iostream>
int main ()
{
int x;
char b[4] = {'a','b','ba','s'};
std::cout <<b[0] <<std::endl;
std::cout <<b[1] <<std::endl;
std::cout <<b[2] <<std::endl;
std::cout <<b[3] <<std::endl;
std::cin >> x;
return 0;
}
