Thread: I dont understand a piece of this code

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    33

    I dont understand a piece of this code

    Code:
    void morse_code_letters(char morse_strings[91][6])
    {
    	//morse code letters using string copy
    	strcpy (morse_strings['A'], ".-");
    	strcpy (morse_strings['B'], "-...");
    	strcpy (morse_strings['C'], " -.-.");
    	strcpy (morse_strings['D'], "-..  ");
    	strcpy (morse_strings['E'], ".");
    	strcpy (morse_strings['F'], "..-.");
    	strcpy (morse_strings['G'], "--.");
    	strcpy (morse_strings['H'], "....");
    	strcpy (morse_strings['I'], "..");
    	strcpy (morse_strings['J'], ".---");
    	strcpy (morse_strings['K'], "-.-");
    	strcpy (morse_strings['L'], ".-..");
    	strcpy (morse_strings['M'], "--");
    	strcpy (morse_strings['N'], "-.");
    	strcpy (morse_strings['O'], "---");
    	strcpy (morse_strings['P'], ".--.");
    	strcpy (morse_strings['Q'], "--.-");
    	strcpy (morse_strings['R'], ".-.");
    	strcpy (morse_strings['S'], "...");
    	strcpy (morse_strings['T'], "-");
    	strcpy (morse_strings['U'], "..-");
    	strcpy (morse_strings['V'], "...-");
    	strcpy (morse_strings['W'], ".--");
    	strcpy (morse_strings['X'], "-..-");
    	strcpy (morse_strings['Y'], "-.--");
    	strcpy (morse_strings['Z'], "--..");
    	// morse code numbers using string copy
    	strcpy (morse_strings['1'], ".----");
    	strcpy (morse_strings['2'], "..---");
    	strcpy (morse_strings['3'], "...--");
    	strcpy (morse_strings['4'], "....-");
    	strcpy (morse_strings['5'], ".....");
    	strcpy (morse_strings['6'], "-....");
    	strcpy (morse_strings['7'], "--...");
    	strcpy (morse_strings['8'], "---..");
    	strcpy (morse_strings['9'], "----.");
    	strcpy (morse_strings['0'], "-----");
    	// morse code characters using string copy
    	strcpy (morse_strings['.'], ".-.-.-");
    	strcpy (morse_strings[','], "--..--");
    	strcpy (morse_strings['?'], "..--..");
    	strcpy (morse_strings[' '], " ");
    }


    I dont understand why the [91] and [6] are there. What do the numbers mean? and what do they do?
    Last edited by Salem; 06-12-2011 at 11:32 PM. Reason: Remove stupid font size

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-03-2011, 12:29 AM
  2. i dont understand bit
    By joker_tony in forum C Programming
    Replies: 2
    Last Post: 03-27-2008, 12:15 AM
  3. need help to understand a piece of code
    By rraajjiibb in forum C Programming
    Replies: 3
    Last Post: 08-09-2004, 11:18 PM
  4. What I dont understand...
    By nomi in forum C# Programming
    Replies: 7
    Last Post: 01-20-2004, 02:00 AM
  5. dont understand VS.NET
    By Qui in forum Windows Programming
    Replies: 6
    Last Post: 10-15-2003, 07:36 PM