title: How to check airplane seat reservation in C++
body: <p>I am new to C++ and I am trying to reserve a seat in airplane with an two dimensional array; everything work except it won't check if the seat is already taken.</p>
  
  <pre><code>for example: 
   1  A B C D
   2  A B C D
   3  A B C D
   4  A B C D
   5  A B C D
  </code></pre>
  
  <p>if the user choose row 1 letter A then it will be:</p>
  
  <pre><code> 1  X B C D
   2  A B C D
   3  A B C D
   4  A B C D
   5  A B C D
  </code></pre>
  
  <p>Then if the user choose row 1 letter A again it should display message says the seat is already taken.This is my code </p>
  
  <pre><code>void reserveSeat(char seatChart[ROW][COLUM]){
  
      int row;
      char colum;
  
      cout&lt;&lt;"Enter the row number with colum letter ex(0 A): ";
      cin&gt;&gt;row&gt;&gt;colum;
      colum = toupper(colum);
  
      for(int r = 0; r&lt;ROW;r++){
  
          for(int c = 0; c&lt;COLUM;c++){
  
              if(seatChart[row][c] == colum){
  
                  //check if the seat is taken
                  if( seatChart[row][c] == 'X'){
  
                      cout&lt;&lt;"seat is already taken\n\n";
                  }else
                      seatChart[row][c] = 'X';   
              } 
          }//end of inner for loop
      }//end of outer for loop
  }
  </code></pre>