Kl2eativ 0 Newbie Poster

I need to add sound to this code but I cannot figure it out! Help!!

#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;


int main()

{
    int i, j;
    int iL;
    char alph[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    char *morse[] = 
    { 
        ".-"   , "-..." , "-.-." , "-.."  , "."    ,    /* a-e */
        "..-." , "--."  , "...." , ".."   , ".---" ,    /* f-j */
        "-.-"  , ".-.." , "--"   , "-."   , "---"  ,    /* k-o */
        ".--." , "--.-" , ".-."  , "..."  , "-"    ,    /* p-t */
        "..-"  , "...-" , ".--"  , "-..-" , "-.--" ,    /* u-y */
        "--.." ,                                        /* z   */
        "-----", ".----", "..---", "...--", "....-",    /* 0-4 */
        ".....", "-....", "--...", "---..", "----.",    /* 5-9 */ 
        "--..--", ".-.-.-"                              /* ,.  */
    };


    char inbuf[BUFSIZ];
    int numchars = strlen(alph);

    cout <<"Enter a phrase to be translated into Morse Code:\n\n";
    fgets(inbuf, BUFSIZ, stdin);

    iL = strlen(inbuf) - 1;    

    for (i = 0; i < iL; i++) 
    {
        inbuf[i] = toupper(inbuf[i]);
    }
    for (i = 0; i < iL; i++) 
    {
        if (inbuf[i] == ' ')
            cout<<"  ";
        else
            for (j = 0; j <= numchars; j++) 
            {
                if (inbuf[i] == alph[j]) 
                {
                   printf("%s ", morse[j]);
                }

            }

    }
    system("PAUSE");
    return 0;
    
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.