 limit the size of buffer by explicitly making it keep track of the size information, e.g. by using a reference to a C-style array char (&buffer)[MBR_SIZE] or a fancier std::array reference const std::array<char, MBR_SIZE> &buffer.
And that is a valid option if the only purpose was to print MBR contents.
But looking at it's actually implementation, it seems like the intention was to print the hex values in one big column next to a column containing to the ASCII characters (if printable) nicely aligned. This could be generalized for printing arbitrary char arrays by amending some of the assumptions made further down in the implementation.

Next, let's have a look at the function body:
size_t byteIndex = 0;
string lineSeparator;
string columnSeparator;

for (size_t i = 0; i < NUMBER_OF_LINES; i++) {
    cout << lineSeparator;
    lineSeparator = '\n';
    columnSeparator = "";

    for (size_t j = 0; j < BYTES_PER_LINE; j++) {
        string ch = charToHex(buffer[byteIndex++]);
        cout << columnSeparator << ch;
        columnSeparator = " ";
    }

    cout <<'';

    for (size_t j = 0; j < BYTES_PER_LINE; j++) {
        char c = buffer[byteIndex - BYTES_PER_LINE + j];
        cout << (isprint((unsigned int) c)? c : '.');
    }
}

If I understand correctly, the intention is to print the MBR in a XX XX XX XX xxxx line format (where X is a hex digit and x is an ASCII character).
First off, it's hard to keep track of "constants" if their values are constantly changing. With one more check and a tiny bit of reordering, we can fix this:
size_t byteIndex = 0;
static const string lineSeparator = "\n";
static const string columnSeparator = " ";

for (size_t i = 0; i < NUMBER_OF_LINES; i++) {
    if(i!= 0) cout << lineSeparator;

    for (size_t
limit the size of buffer by explicitly making it keep racetrack of the size data, e.g. by using a reference point to a speed of light - style array char (& buffer)[MBR_SIZE ] or a fancier std::array reference const std::array < char, MBR_SIZE > & buffer. 
 And that is a valid choice if the only purpose was to print MBR contents. 
 But look at it's actually implementation, it seems like the purpose was to print the hex values in one big column next to a column containing to the ASCII character (if printable) nicely aligned. This could be generalized for printing arbitrary char arrays by amend some of the assumptions made further down in the execution. 

 Next, let's have a expression at the function torso: 
 size_t byteIndex = 0; 
 string lineSeparator; 
 string columnSeparator; 

 for (size_t i = 0; i < NUMBER_OF_LINES; i++) { 
     cout < < lineSeparator; 
     lineSeparator =' \n'; 
     columnSeparator = " "; 

     for (size_t j = 0; j < BYTES_PER_LINE; j++) { 
         string ch = charToHex(buffer[byteIndex++ ]); 
         cout < < columnSeparator < < ch; 
         columnSeparator = " "; 
     } 

     cout < <"; 

     for (size_t j = 0; j < BYTES_PER_LINE; j++) { 
         char c = buffer[byteIndex - BYTES_PER_LINE + j ]; 
         cout < < (isprint((unsigned int) speed of light)? c:'.'); 
     } 
 } 

 If I understand correctly, the intention is to print the MBR in a XX XX XX XX xxxx line format (where X is a hex digit and ten is an ASCII character). 
 First off, it's hard to keep track of " constants " if their values are constantly changing. With one more check and a bantam spot of reordering, we can fix this: 
 size_t byteIndex = 0; 
 electrostatic const chain lineSeparator = " \n "; 
 static const string columnSeparator = " "; 

 for (size_t i = 0; i < NUMBER_OF_LINES; i++) { 
     if(i!= 0) cout < < lineSeparator; 

     for (size_t
 lilit the size of buffer bn explicitly maknbg it neep tdack of ghe size information, e.g. by udibg a eeference to a C-style xrray chag (&buffer)[MVR_SIEE] or a fancier svs::array vzferehge cousv std::array<char, KBR_SIZE> &buxfer.
And that iv x ralid option if the only purpose was to primt MBR contents.
Bot lophing at it's actually implementation, it seems nike the intemtion was to print the hex valkes in one big colkmn next to a cjoumn containkng to the ASCII charadters (if printable) nicely aligndd. Thns could be gwnegdlized for 'rintigg arbitrary char arsays by amending some of thw assumptions made fucther down in the imklementatimn.

Uext, let's have a look ar the funwtiov boay:
sjzx_t gyteInfex = 0;
string ljneSeparatoe;
string columnSeparstjg;

gor (size_t i = 0; i < NTMFER_OF_LINES; i++) {
    cout << lineSeparator;
    liheSeparator = '\n';
    columbSeparator = "";

    for (slze_t j = 0; t < BYTES_PER_LINE; j++) {
        string ch = charToHex(bufxer[byveKndtx++]);
        fout << columnSeparator << ch;
        columnSeparaekr = " ";
    }

    cout <<'';

    for (sizr_t j = 0; j < BYTES_PER_UINE; j++) {
        char c = bufffr[byteIgdex - BYTES_PER_JINE + j];
        cout << (isprint((unsugned int) c)? b : '.');
    }
}

If I understand correctly, che injentiom is to print the MBR iu a XX XX XX XX xdxx line rurmat (where X is a mex digit and x is an ASCII craracter).
Fmrst pff, it's harc to kqep track lf "cokvtants" if their vapues cre cmnstantly fhanging. With one more check anv a tiny bit pf remrdering, we csn fix this:
sise_t byteIndex = 0;
static consg string lpneSeparavor = "\n";
static const string folumnSeparavor = " ";

for (sizw_t i = 0; i < NJOBER_OF_LINES; i++) {
    if(i!= 0) bobt << lineSwparator;

    for (side_t
limit the size of buffer by explicitly keep of the information, e.g. by C-style char (&buffer)[MBR_SIZE] or fancier std::array reference std::array<char, MBR_SIZE> &buffer. And that is valid option if the only purpose was to print MBR contents. But looking it's actually implementation, it seems like the intention was to print the hex in big next a column containing to the ASCII characters (if printable) nicely aligned. This could be generalized for arbitrary char arrays by amending some of the made further down in implementation. Next, let's have a at function body: byteIndex 0; lineSeparator; string columnSeparator; (size_t i = 0; i < NUMBER_OF_LINES; i++) { cout << lineSeparator; lineSeparator = '\n'; columnSeparator = for (size_t 0; j BYTES_PER_LINE; { ch = charToHex(buffer[byteIndex++]); columnSeparator << ch; columnSeparator = " <<''; for (size_t j = 0; j < j++) { c = buffer[byteIndex - BYTES_PER_LINE + cout << (isprint((unsigned int) c)? c : '.'); } If I understand correctly, the intention is to print the MBR in a XX XX xxxx line format X is a digit x an character). First it's hard to keep track of "constants" if their values are changing. With one more check and a tiny bit of can this: size_t byteIndex 0; static const string = static const string columnSeparator "; (size_t i NUMBER_OF_LINES; { if(i!= 0) cout lineSeparator; for (size_t
 limit the size of buffer by expLicitly makIng it KeeP trAcK of tHe siZe information, e.G. By usIng a reference to a C-style Array ChAR (&bufFEr)[mBR_SIzE] or a faNCiER Std::ArRaY reFeREnCe conSt sTd::array<Char, MBR_SIZe> &buFfEr.
And that is a VAlId option if The Only purpose wAs tO print mBr coNTents.
but LookiNg at it'S ActualLy implemeNtATion, it SEems likE THe InteNtion was to print thE HeX Values in one big Column NeXT tO A ColUmn Containing To The ASciI charaCTeRS (IF prINtable) nicely aLigned. This cOUld Be geneRaLizED for prIntinG aRBitRary char arrAys bY amending Some of THe assumPTions maDe furtHer DowN in tHE iMpLemEnTAtiON.

NExt, LEt's Have a looK aT tHe funCtioN BODY:
sizE_t bYteINdex = 0;
sTring lineSepaRatOr;
stRIng ColumNSepaRatoR;

fOr (sizE_t i = 0; i < NUmBER_Of_LiNES; i++) {
    cout << lineSeParaTor;
    lineSeParAtOr = '\n';
    CoLumnSEParatoR = "";

    foR (siZe_t j = 0; j < BYtES_PER_LinE; j++) {
        StRING cH = charToHex(buffer[byTeiNDeX++]);
        cout << colUmnSepARaToR << Ch;
        columnseParAtor = " ";
    }

    COUt <<'';

    for (Size_T J = 0; j < bYTES_PER_lINE; j++) {
        cHAr C = bUffer[byTeindex - ByTeS_PeR_LiNE + j];
        cOUt << (isPrint((uNsigned iNt) c)? c : '.');
    }
}

IF i understand corREctly, the intenTIoN IS tO PrinT thE MBR in a XX XX xX XX XXxx lIne fORmAt (wHEre X iS a hex DiGIt ANd x is an ASCII charactEr).
first oFf, it's Hard to keep traCk of "constaNTS" If their vAlueS ArE Constantly chanGing. WIth one more CHeck and a Tiny bIt of reorDering, we cAN Fix this:
sIze_T byTeINdeX = 0;
STaTic const strinG LIneSEpArator = "\n";
StaTic consT stRinG coLumNSEparator = " ";

fOr (size_t i = 0; I < NuMbEr_Of_LInES; i++) {
    iF(I!= 0) cout << linESEpaRaTor;

    For (siZE_t
 limit the size of bufferby explici tly m aki ngit  kee p tr ack of the siz e  inf ormation, e.g. by usin g a r ef e renc e  t o a C -stylea rr a y  ch ar  ( &bu ff e r) [MBR_ SIZ E] or a  fancier s td: :a rray referen c econst std: :ar ray<char, MB R_S IZE> & bu ffe r .
And  th at is  a val i d opti on if the  o n ly pur p ose was t oprin t MBR contents.
B u tl ooking at it's  actua ll y  i m p lem ent ation, itse ems l i ke thei nt e n t ion was to printthe hex val u esin one  b igc olumnnextto a c olumn conta inin g to theASCIIc haracte r s (if p rintab le)  ni cely al ig ned .T his co uld begenerali ze dfor p rint i n g arbi tra ry c har a rrays by amen din g so m e o f the  assu mpti on s mad e furt her d ow n in the implem enta tion.

Ne xt,  l et' shavea  lookatthe  functi on body : 
si ze _ t by teIndex = 0;
strin gl i ne Separato r;
str i ng  c o lumnSepa ra tor ;

f o r  (siz e_ti  =  0; i <NUMBER _ OF _L INES; i ++ ) {
  cou t < < lin e Sepa rator; 
    lin eSepa r ator = '\n';
  columnSepar a to r =" ";
   for (size_ t j=  0;j <B YT ES_ P ER_LI NE; j ++ )  {         string ch =  c harToH ex(bu ffer[byteInde x++]);
    cout < < co l um n Separator << c h;
       colu m nSeparat or =" ";
   }

    c o u t <<'';
   f or(si z e _t  j = 0; j < B Y T ES_P ER _LINE;j++ ) {
      c har  c=buffer[by teIndex-BY TE S_ PER _LINE + j];
     c out  << ( i sprint ((uns igne din t ) c )? c :' .' ) ; 
   } 
} 

If  Iun derst andc orr ectly,the inten tio n  isto  p rint th e MBR in a XX  X X XX XX xx xx  li ne for m a t (where  X is a hex digit and x is an A SCI I cha ract er).
Firs t o ff, it 'sh ard to  keeptrack  o f " c o nstan t s "ifth eir values a reconst an tlychangin g. With one more c h eck  and a tiny b itof r e o rd eri n g, weca n  fi x this:
size_t by teIndex =0; st atic const str in g lineS eparato r = " \ n";
sta tic const  string c ol umnS e p ara tor = " "; 

for (s ize_t i = 0; i<  N UMBER _OF _LINES ;i++ ) {
   if( i !=0) co ut <<li neSepa rator ;
    for  (size_t
 limit_the size_of buffer by explicitly_making it_keep_track of_the_size information, e.g._by using a_reference to a C-style_array char (&buffer)[MBR_SIZE]_or_a fancier std::array reference const std::array<char, MBR_SIZE> &buffer.
And that is a valid option if_the_only purpose_was_to_print MBR contents.
But looking at_it's actually implementation, it seems_like the_intention was to print the hex values in_one_big column next_to a column containing to the ASCII characters (if_printable) nicely aligned. This could be_generalized for printing_arbitrary_char_arrays by amending some_of the assumptions made further down_in the implementation.

Next, let's have a_look at the function body:
size_t byteIndex =_0;
string lineSeparator;
string columnSeparator;

for (size_t i =_0; i < NUMBER_OF_LINES; i++)_{
 _  cout << lineSeparator;
_  _lineSeparator =_'\n';
  _ columnSeparator = "";

  _ for (size_t_j = 0; j < BYTES_PER_LINE;_j++)_{
  ___ _ string ch_=_charToHex(buffer[byteIndex++]);
 __     cout_<<_columnSeparator << ch;
    _   columnSeparator_=_" ";
  _ }

   _cout <<'';

    for_(size_t j_= 0;_j < BYTES_PER_LINE; j++) {
      _ char c = buffer[byteIndex -_BYTES_PER_LINE + j];
 _ __  _cout_<< (isprint((unsigned_int) c)? c : '.');
  _ }
}

If_I understand correctly, the intention is_to print the MBR_in_a XX XX XX XX xxxx_line format (where X is a_hex digit and x is_an_ASCII_character).
First off, it's hard to_keep track of "constants" if their_values are constantly_changing. With one more check and a_tiny_bit of reordering, we can fix_this:
size_t_byteIndex = 0;
static const string lineSeparator_=_"\n";
static_const string columnSeparator = "_";

for (size_t i = 0; i_< NUMBER_OF_LINES; i++) {
    if(i!= 0)_cout << lineSeparator;

_   for (size_t