title: C. 2D array crossword like program
body: <p>I have Created a 2D array of characters that has 20 rows and 30 columns (accomplished in main( ) ). I then populated each element of the 2D array with a random upper-case character and displayed that 2D character array to the screen(accomplished in a function named function1( ) ).</p>
  
  <p>I am now trying to create a function named function2 that will traverse the array looking for <strong><em>horizontal</em></strong> pairs of characters. I am new to coding and unsure of the possible ways that this could be accomplished. What would be the best way to accomplish this task?</p>
  
  <p>(Note: Three identical characters in a row would be counted as 2 pairs. Four identical characters in a row would be counted as 3 pairs, etc.)</p>
  
  <pre><code>#include &lt;stdio.h&gt; 
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt; 
  
  #define ROW 20
  #define COLUMN 30
  
  char function1 ( char [ROW] [COLUMN]) ;
  
  
  int main( void )
  {  
  
  char randchar_array [ROW] [COLUMN]; 
  srandom ( (unsigned) time (NULL) ); 
  
  printf( "\n Welcome User.\n\n" ) ;
  
  function1 (randchar_array);
  
  printf("\n\n Thank you for using this program.\n\n" ) ;
  
  
  return ( 0 ) ;
  
  }
  
  char function1 (char randchar_array[ROW] [COLUMN]) 
  
  {
  int r = 0 ;
  int c = 0 ;
  char nextchar = 'A';
  
     for (r = 0; r &lt; ROW ; r++)
     {
         for (c = 0; c &lt; COLUMN ; c++)
         {
            nextchar = 'A' + random() % 26;
            randchar_array [r] [c] = nextchar;
            printf(" %c", nextchar);
         }
  
        printf("\n");
      }
  
     return (randchar_array [ROW] [COLUMN]);
   }
  </code></pre>
  
  <p>Output so far:</p>
  
  <pre><code> Welcome User.
  
   P K E J A K E F J M W V H X V S T J T C L Q K P Q R G Q Y E
   K P P R B R B F W M R U H A S E S N Q N R B D C Q T T Z J U
   F W J W P K N S P M F I G O K A T C O J Q F M T J D P D C A
   Z H Y I E N V T G M F N X O B H O W M E H C M U X V Z M A D
   N Z M L K S B F M H T T W Q H X A W W M A D O M Z N K Y A K
   B P K O A U I B B U K U O G N V G N T C Z W H P K J C U J E
   F L T R B W N J Z O G K K U S X R Y M N C L J M C T V H O G
   L V T F M W D Z G C P O M Z K H Z D H L Q K Z Z Y B T V K H
   B W E V D Q R G R Z I G N X H Z E G D L U T X T T V W O S H
   X U F B R I R I O K K Y S Z V Z Z B I C P E X M Z S K V G C
   E D Y J E P T X Y J H K I Z J F B I J L M Y P K M O C W L L
   B S O Z D V P X U P I C Z S D I Y G T J T F H I R T Y W S M
   H T E X U J S J I N A R R B J W M J D H S W M Z H E V H A N
   T J I Z G C J Z O R O Q K H S U D G D G N W F B X M H U T J
   J P S R Q Z W B A K V Q C F X W Z A C F J R D O T C C A X X
   K G O E A F D W G F I B V K H S J I V L P E F S U Y X W A U
   T M C I R E P U C V C K X X X E S G O N T E T Y Y N Y V J B
   R E N W O E A D B D Z D P W A O C U U S J Q W C Q X P P S Y
   S M F F I T K K X L N Y Q F W S T Y N Q S W G R Z Y O O P I
   P H U U N E P Z P O M E M C L I U F I H X B G D S F D I V T
  
  
   Thank you for using this program.
  </code></pre>