#include <iostream>
#include <string>
#include <cctype>

enum
{
  col_count = 5 + 1,
  row_count = 7,
  glyph_count = 26
};

typedef const char row_t[ col_count ];
typedef const row_t glyph_t[ row_count ];
typedef const glyph_t glyph_set_t[ glyph_count ];
typedef std::string line_t[ row_count ];

glyph_set_t gs
{
{
{"  A  "},
{" A A "},
{"A   A"},
{"A   A"},
{"AAAAA"},
{"A   A"},
{"A   A"},
},

{
{"BBBB "},
{"B   B"},
{"B   B"},
{"BBBB "},
{"B   B"},
{"B   B"},
{"BBBB "},
},
//...
};

int main()
{
  const char* s = "AB";

  for( int r = 0; r < row_count; ++r )
  {
    for( const char* p = s; *p; ++p )
    {
      int set_idx = std::toupper( *p ) - 'A';
      // this...
      glyph_t& g = gs[ set_idx ];
      std::cout << g[ r ] << ' ';
      // ...or this (whichever is easier for you)
      // std::cout << gs[ set_idx ][ r ] << ' ';
    }
    std::cout << std::endl;
  }
  return 0;
}