Morse code Converter
Morse code is a code where each letter of the English alphabet, each digit and various punctuation characters are represented by a series of dots and dashes.
Write a program that asks the user to enter the string: “Yesterday, I slept most of the night. I saw no stars.” and then calls a function Morse that takes a character array and its size as arguments and converts that string to Morse code, and places the code into another array called morse.
Hint: Place all alphabets in an array named RegularText. Place all Morse codes in an array called MorseCode.
The string is: Use the getline function to input the above string.
The table below shows part of the code.

Character Code Character Code Character Code Character Code
Space space e . l .-.. s …
comma --..-- f ..-. m -- t -
Period .-.-.- g --. n -. u ..-
a .- h …. o --- v …-
b -… i .. p .--. w .--
c -.-. j .--- q --.- x -..-
d -.. k -.- r .-. y -.--

i wrote so far this....

using namespace std;

void Morse(char[],int);
int main()

	char string[100];
	cout<<"please enter the line of text to transform it to the morse code.\n";
	cout<<"\nprinting the array";

	return 0;

void Morse(char s1[],int size)
	char regulartext[50]={' ',',','.','a','b','c','d','e','f','g',
	char *morsecode[50]={" ","--..--",".-.-.-",".-","-...","-.-.","-..",".",

	for(int i=0;(s1[i])!='\0';i++)
		for(int j=0;j<100;j++)
			for(int k=0;k<100;k++)
This article has been dead for over six months. Start a new discussion instead.