Also why it is not printing garbage when I provide m > my column values like in the second case? Any specific reason?
#include <iostream>
using namespace std;
int main()
{
char a[2][5] = {{'a', 'b', 'c', 'd', 's'}, {'e', 'f', 'g', 'h', 'q'}};
cout << a[0] << endl; // abcdsefghq!V
cout << a[1] << endl; // efghq!V
char a1[][6] = {{'a', 'b', 'c', 'd', 's'}, {'e', 'f', 'g', 'h', 'q'}};
cout << a1[0] << endl; // abcds
cout << a1[1] << endl; // efghq
return 0;
}